Update to Minecraft 1.17.1 (#6097)

This commit is contained in:
Nassim Jahnke 2021-07-07 08:52:40 +02:00 committed by GitHub
parent a831634d44
commit 56fd1a2f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
266 changed files with 1415 additions and 1491 deletions

View File

@ -2,5 +2,5 @@
# Merchant.getLevel() # Merchant.getLevel()
# Entity.getCommandSenderWorld() # Entity.getCommandSenderWorld()
# to getWorld(), which confuses our ability to map this method properly. This patch disambiguates it # to getWorld(), which confuses our ability to map this method properly. This patch disambiguates it
net/minecraft/world/item/trading/IMerchant fD ()Lnet/minecraft/world/level/World; getLevel net/minecraft/world/item/trading/IMerchant fE ()Lnet/minecraft/world/level/World; getLevel
net/minecraft/world/entity/npc/EntityVillagerAbstract fD ()Lnet/minecraft/world/level/World; getLevel net/minecraft/world/entity/npc/EntityVillagerAbstract fE ()Lnet/minecraft/world/level/World; getLevel

View File

@ -35,7 +35,7 @@ c net/minecraft/world/level/block/MultifaceBlock net/minecraft/world/level/block
# another missed one # another missed one
c net/minecraft/server/players/UserCache net/minecraft/server/players/GameProfileCache c net/minecraft/server/players/UserCache net/minecraft/server/players/GameProfileCache
m (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile; getProfile get m (Ljava/lang/String;)Ljava/util/Optional; getProfile get
p 0 name p 0 name
# change dimension in ServerPlayer # change dimension in ServerPlayer

View File

@ -228,3 +228,6 @@ public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeT
# Improve CraftChunk#getEntities # Improve CraftChunk#getEntities
public net.minecraft.world.level.entity.PersistentEntitySectionManager sectionStorage public net.minecraft.world.level.entity.PersistentEntitySectionManager sectionStorage
# Optimize light engine
public-f net.minecraft.world.level.chunk.DataLayer

View File

@ -71,7 +71,7 @@ repositories {
} }
dependencies { dependencies {
paramMappings("org.quiltmc:yarn:1.17+build.2:mergedv2") paramMappings("org.quiltmc:yarn:1.17.1+build.1:mergedv2")
remapper("org.quiltmc:tiny-remapper:0.4.1") remapper("org.quiltmc:tiny-remapper:0.4.1")
decompiler("net.minecraftforge:forgeflower:1.5.498.12") decompiler("net.minecraftforge:forgeflower:1.5.498.12")
paperclip("io.papermc:paperclip:2.0.1") paperclip("io.papermc:paperclip:2.0.1")

View File

@ -1,7 +1,7 @@
group = io.papermc.paper group = io.papermc.paper
version = 1.17-R0.1-SNAPSHOT version = 1.17.1-R0.1-SNAPSHOT
mcVersion = 1.17 mcVersion = 1.17.1
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.vfs.watch=false org.gradle.vfs.watch=false

View File

@ -19,7 +19,7 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4
/.project /.project
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..db581a25928b3d60906fef0dc8df1bf976e1635e index 0000000000000000000000000000000000000000..6e64a444fb20aabaabfb15a30d645702c11c2da8
--- /dev/null --- /dev/null
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
@ -85,14 +85,14 @@ index 0000000000000000000000000000000000000000..db581a25928b3d60906fef0dc8df1bf9
+tasks.withType<Javadoc>().configureEach { +tasks.withType<Javadoc>().configureEach {
+ (options as StandardJavadocDocletOptions).links( + (options as StandardJavadocDocletOptions).links(
+ "https://guava.dev/releases/21.0/api/docs/", + "https://guava.dev/releases/21.0/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", + "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/", + "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", + "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ ) + )
+} +}
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
deleted file mode 100644 deleted file mode 100644
index 10eeaef61be733e63f6680f1675e0b527eb30fd9..0000000000000000000000000000000000000000 index 6f6a86034a4c312a4af97d6984a6a4547217cbf6..0000000000000000000000000000000000000000
--- a/pom.xml --- a/pom.xml
+++ /dev/null +++ /dev/null
@@ -1,262 +0,0 @@ @@ -1,262 +0,0 @@
@ -103,7 +103,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- -
- <groupId>org.spigotmc</groupId> - <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId> - <artifactId>spigot-api</artifactId>
- <version>1.17-R0.1-SNAPSHOT</version> - <version>1.17.1-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging> - <packaging>jar</packaging>
- -
- <name>Spigot-API</name> - <name>Spigot-API</name>
@ -241,7 +241,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- <dependency> - <dependency>
- <groupId>org.eclipse.jdt</groupId> - <groupId>org.eclipse.jdt</groupId>
- <artifactId>ecj</artifactId> - <artifactId>ecj</artifactId>
- <version>3.24.0</version> - <version>3.26.0</version>
- </dependency> - </dependency>
- </dependencies> - </dependencies>
- </plugin> - </plugin>
@ -263,7 +263,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- <plugin> - <plugin>
- <groupId>org.apache.maven.plugins</groupId> - <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId> - <artifactId>maven-shade-plugin</artifactId>
- <version>3.2.3</version> - <version>3.2.4</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>package</phase> - <phase>package</phase>
@ -288,12 +288,12 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- <plugin> - <plugin>
- <groupId>org.apache.maven.plugins</groupId> - <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId> - <artifactId>maven-javadoc-plugin</artifactId>
- <version>3.2.0</version> - <version>3.3.0</version>
- <configuration> - <configuration>
- <links> - <links>
- <link>https://guava.dev/releases/21.0/api/docs/</link> - <link>https://guava.dev/releases/21.0/api/docs/</link>
- <link>https://javadoc.io/doc/org.yaml/snakeyaml/1.27/</link> - <link>https://javadoc.io/doc/org.yaml/snakeyaml/1.28/</link>
- <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/</link> - <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/</link>
- <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link> - <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link>
- </links> - </links>
- </configuration> - </configuration>
@ -312,7 +312,7 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- <plugin> - <plugin>
- <groupId>org.apache.maven.plugins</groupId> - <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId> - <artifactId>maven-checkstyle-plugin</artifactId>
- <version>3.1.1</version> - <version>3.1.2</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>
@ -329,14 +329,14 @@ index 10eeaef61be733e63f6680f1675e0b527eb30fd9..00000000000000000000000000000000
- <dependency> - <dependency>
- <groupId>com.puppycrawl.tools</groupId> - <groupId>com.puppycrawl.tools</groupId>
- <artifactId>checkstyle</artifactId> - <artifactId>checkstyle</artifactId>
- <version>8.39</version> - <version>8.44</version>
- </dependency> - </dependency>
- </dependencies> - </dependencies>
- </plugin> - </plugin>
- <plugin> - <plugin>
- <groupId>org.codehaus.mojo</groupId> - <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId> - <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.19</version> - <version>1.20</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index db581a25928b3d60906fef0dc8df1bf976e1635e..5a328158622346deee6c83215fa56f64e2ba55e2 100644 index 6e64a444fb20aabaabfb15a30d645702c11c2da8..db6a7b2e60da0d96ef96545a781f1e056482d6ff 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -17,12 +17,14 @@ dependencies { @@ -17,12 +17,14 @@ dependencies {
@ -27,8 +27,8 @@ index db581a25928b3d60906fef0dc8df1bf976e1635e..5a328158622346deee6c83215fa56f64
@@ -61,7 +63,7 @@ tasks.withType<Javadoc>().configureEach { @@ -61,7 +63,7 @@ tasks.withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).links( (options as StandardJavadocDocletOptions).links(
"https://guava.dev/releases/21.0/api/docs/", "https://guava.dev/releases/21.0/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/", - "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations + "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // 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/1.16-R0.4/",
) )

View File

@ -7,7 +7,7 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index f0b501b9a6b2d1d516d644c960bb3be785a1415b..ea3a12608a851b25afa01ee127c6ef91a3d64fff 100644 index 17fd7162ab32785252bf2579daae8d47aec21684..479d4e3b91e902e9b30d351aa65c8b079555d7e0 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -10,6 +10,8 @@ java { @@ -10,6 +10,8 @@ java {
@ -32,7 +32,7 @@ index f0b501b9a6b2d1d516d644c960bb3be785a1415b..ea3a12608a851b25afa01ee127c6ef91
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
@@ -66,5 +73,11 @@ tasks.withType<Javadoc>().configureEach { @@ -66,5 +73,11 @@ tasks.withType<Javadoc>().configureEach {
"https://javadoc.io/doc/org.yaml/snakeyaml/1.27/", "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/",
"https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // 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/1.16-R0.4/",
+ // Paper start + // Paper start
@ -447,7 +447,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 73dafe6093b4c5c385efc8529fab76189085e9d0..f0a28cbb92edf990a3aef076af183cc9796987f3 100644 index 05595fea641dbbc3d5eefb262731faad5bdb7965..cc208227301b30c3717516ceb9529ca6cb2fd0de 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -302,7 +302,9 @@ public final class Bukkit { @@ -302,7 +302,9 @@ public final class Bukkit {
@ -731,7 +731,7 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index b72a8d2ca0c5b6d78c0a5ca5cc30d8216c34ee88..650b9afc846b1ead0322a4b3ebcdad2d449670da 100644 index bc4c4b6a10726347649a9232ee8ede28c967b8f4..cb0f365c4829f382a8fef8c176b7ea4028cac876 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -55,13 +55,13 @@ import org.jetbrains.annotations.Nullable; @@ -55,13 +55,13 @@ import org.jetbrains.annotations.Nullable;
@ -1087,7 +1087,7 @@ index bc4417d8ffa92a78f690bfa5705d3e42cdc11fd2..d3519fa5b99e2888a194c63824155377
* Returns a list of entities within a bounding box centered around a * Returns a list of entities within a bounding box centered around a
* Location. * Location.
diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java
index a52dff9ef1c1cd7d3705e66510dfa2c91119539c..cdcf02ff9e80f5908a8fa22e82701445d5e2d298 100644 index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa330588600b 100644
--- a/src/main/java/org/bukkit/block/Sign.java --- a/src/main/java/org/bukkit/block/Sign.java
+++ b/src/main/java/org/bukkit/block/Sign.java +++ b/src/main/java/org/bukkit/block/Sign.java
@@ -7,13 +7,48 @@ import org.jetbrains.annotations.NotNull; @@ -7,13 +7,48 @@ import org.jetbrains.annotations.NotNull;
@ -1141,8 +1141,8 @@ index a52dff9ef1c1cd7d3705e66510dfa2c91119539c..cdcf02ff9e80f5908a8fa22e82701445
/** /**
@@ -24,8 +59,10 @@ public interface Sign extends TileState, Colorable { @@ -24,8 +59,10 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to get the text from, starting at 0 * @param index Line number to get the text from, starting at 0
* @throws IndexOutOfBoundsException Thrown when the line does not exist
* @return Text on the given line * @return Text on the given line
* @throws IndexOutOfBoundsException Thrown when the line does not exist
+ * @deprecated in favour of {@link #line(int)} + * @deprecated in favour of {@link #line(int)}
*/ */
@NotNull @NotNull
@ -1976,7 +1976,7 @@ index 9c68c3f2d61500479f48b80264f625aaae2f3204..399afcd19fcb6acd24857ed6ab48cf0d
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
private boolean cancel = false; private boolean cancel = false;
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index c8384da69af61e1970f254a3a9c206ee81d7a989..d3b4219a57fff4519ef8d803c333c854fafa7859 100644 index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5aae94468 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull; @@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
@ -2318,10 +2318,10 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
@NotNull @NotNull
diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
index 1db386bb701cb6974daedc6bb5b93a3afbc42100..84521186404b8e43c81a2f9513dce2be40d27840 100644 index 36b436e145a7215682b692a87ab894df25752c1d..ebd499c1a2d11ea068e8c374edbc3967e4cece3d 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java --- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
@@ -12,18 +12,32 @@ public class PlayerLocaleChangeEvent extends PlayerEvent { @@ -12,17 +12,31 @@ public class PlayerLocaleChangeEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
// //
private final String locale; private final String locale;
@ -2344,9 +2344,8 @@ index 1db386bb701cb6974daedc6bb5b93a3afbc42100..84521186404b8e43c81a2f9513dce2be
} }
/** /**
* @see Player#getLocale()
*
* @return the player's new locale * @return the player's new locale
* @see Player#getLocale()
+ * @deprecated in favour of {@link #locale()} + * @deprecated in favour of {@link #locale()}
*/ */
@NotNull @NotNull
@ -3465,7 +3464,7 @@ index 4dba721aefe4fc6699b3b4bfa7ecb0b19c2a2a1a..01dec2c877df58c9dc22445e8b1f9ce2
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index f5cbf6df32ef169cf0f2266f7c6e9c4f771ccb7d..58bddb11fd534e7c33a4ffd7b72b055ba92c767a 100644 index 7277f62d77cd94dc34fd8ac4fad64ebeffe056e4..6279957b9bc6d22881f092eabf3a99831d85e3ee 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java --- a/src/main/java/org/bukkit/scoreboard/Objective.java
+++ b/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/src/main/java/org/bukkit/scoreboard/Objective.java
@@ -19,14 +19,35 @@ public interface Objective { @@ -19,14 +19,35 @@ public interface Objective {
@ -3515,7 +3514,7 @@ index f5cbf6df32ef169cf0f2266f7c6e9c4f771ccb7d..58bddb11fd534e7c33a4ffd7b72b055b
/** /**
diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
index 4bfaaea78c9b6aa5d392629aa943d26dbe6a7d4a..f09ff32cc3ffc16af379a378b1948991435393e8 100644 index d283f6947d775a3bc3a9b2f75db9ab733d819a06..93089ce61d2e1888df13b7c9629a79cd6f5f767a 100644
--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java --- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java
+++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
@@ -27,6 +27,48 @@ public interface Scoreboard { @@ -27,6 +27,48 @@ public interface Scoreboard {
@ -3590,7 +3589,7 @@ index 4bfaaea78c9b6aa5d392629aa943d26dbe6a7d4a..f09ff32cc3ffc16af379a378b1948991
/** /**
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index da01d2926cc8a2485a3349ac1ebb32cad20e287c..f0af10a5b9ad048be197ed5ec6c8ed2672eb3dd5 100644 index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..30fce0df75494eb9b7409f08ea3d6ff894f7c79f 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java --- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -22,14 +22,95 @@ public interface Team { @@ -22,14 +22,95 @@ public interface Team {

View File

@ -8,27 +8,27 @@ Add the following:
- Enable/Disable slot interactions - Enable/Disable slot interactions
diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java
index 575f48213cd8df038e41bead4c9d0fcba717f40f..2f0c6af7fa6688a98d6aa0bd3f0e6556af8330d0 100644 index bf7ded92ed2d39f57bc828a6290a8e9e7afe3a0c..21c8ec6d8b795799b5b110be57ffd27fc8dcabe3 100644
--- a/src/main/java/org/bukkit/entity/ArmorStand.java --- a/src/main/java/org/bukkit/entity/ArmorStand.java
+++ b/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java
@@ -13,7 +13,7 @@ public interface ArmorStand extends LivingEntity { @@ -14,7 +14,7 @@ public interface ArmorStand extends LivingEntity {
* Returns the item the armor stand is currently holding.
* *
* @return the held item * @return the held item
* @see #getEquipment()
- * @deprecated prefer {@link EntityEquipment#getItemInHand()} - * @deprecated prefer {@link EntityEquipment#getItemInHand()}
+ * @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper + * @deprecated prefer {@link ArmorStand#getItem(EquipmentSlot)} // Paper
* @see #getEquipment()
*/ */
@NotNull @NotNull
@@ -25,7 +25,7 @@ public interface ArmorStand extends LivingEntity { @Deprecated
* @@ -26,7 +26,7 @@ public interface ArmorStand extends LivingEntity {
* @param item the item to hold * @param item the item to hold
* @see #getEquipment()
* @deprecated prefer * @deprecated prefer
- * {@link EntityEquipment#setItemInHand(org.bukkit.inventory.ItemStack)} - * {@link EntityEquipment#setItemInHand(org.bukkit.inventory.ItemStack)}
+ * {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper + * {@link ArmorStand#setItem(EquipmentSlot, ItemStack)} // Paper
* @see #getEquipment()
*/ */
@Deprecated @Deprecated
void setItemInHand(@Nullable ItemStack item);
@@ -376,5 +376,71 @@ public interface ArmorStand extends LivingEntity { @@ -376,5 +376,71 @@ public interface ArmorStand extends LivingEntity {
* @param tick {@code true} if this armour stand can tick, {@code false} otherwise * @param tick {@code true} if this armour stand can tick, {@code false} otherwise
*/ */

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add getMainThreadExecutor to BukkitScheduler
diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
index ac140fc2c638e22e06b2920db3e376ab9e8c3733..f5e3bfd22d4d38182065b5215e5f78d9bb13381e 100644 index c239c4de617933d20f75c33f943ba4a88954144e..1ea49965bf72edd862dc0d43e42c61df80966e45 100644
--- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
+++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
@@ -458,4 +458,15 @@ public interface BukkitScheduler { @@ -457,4 +457,15 @@ public interface BukkitScheduler {
@Deprecated @Deprecated
@NotNull @NotNull
public BukkitTask runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) throws IllegalArgumentException; public BukkitTask runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) throws IllegalArgumentException;

View File

@ -161,7 +161,7 @@ index 0000000000000000000000000000000000000000..e9db6b3bad237c0b3fdb14e96b6f0f29
+} +}
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
deleted file mode 100644 deleted file mode 100644
index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..0000000000000000000000000000000000000000 index 9dafd60b6dcabf203ee6d60c0ea82d2845b9eec7..0000000000000000000000000000000000000000
--- a/pom.xml --- a/pom.xml
+++ /dev/null +++ /dev/null
@@ -1,472 +0,0 @@ @@ -1,472 +0,0 @@
@ -171,7 +171,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000
- <groupId>org.spigotmc</groupId> - <groupId>org.spigotmc</groupId>
- <artifactId>spigot</artifactId> - <artifactId>spigot</artifactId>
- <packaging>jar</packaging> - <packaging>jar</packaging>
- <version>1.17-R0.1-SNAPSHOT</version> - <version>1.17.1-R0.1-SNAPSHOT</version>
- <name>Spigot</name> - <name>Spigot</name>
- <url>https://www.spigotmc.org/</url> - <url>https://www.spigotmc.org/</url>
- -
@ -516,7 +516,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000
- <dependency> - <dependency>
- <groupId>org.eclipse.jdt</groupId> - <groupId>org.eclipse.jdt</groupId>
- <artifactId>ecj</artifactId> - <artifactId>ecj</artifactId>
- <version>3.24.0</version> - <version>3.26.0</version>
- </dependency> - </dependency>
- </dependencies> - </dependencies>
- </plugin> - </plugin>
@ -552,7 +552,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000
- <plugin> - <plugin>
- <groupId>org.apache.maven.plugins</groupId> - <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId> - <artifactId>maven-checkstyle-plugin</artifactId>
- <version>3.1.1</version> - <version>3.1.2</version>
- <executions> - <executions>
- <execution> - <execution>
- <phase>process-classes</phase> - <phase>process-classes</phase>
@ -569,7 +569,7 @@ index 2f0e513c9e5d78a22e7d1e1a5aa64bb8f0f360d2..00000000000000000000000000000000
- <dependency> - <dependency>
- <groupId>com.puppycrawl.tools</groupId> - <groupId>com.puppycrawl.tools</groupId>
- <artifactId>checkstyle</artifactId> - <artifactId>checkstyle</artifactId>
- <version>8.39</version> - <version>8.44</version>
- </dependency> - </dependency>
- </dependencies> - </dependencies>
- </plugin> - </plugin>

View File

@ -600,10 +600,10 @@ index 1707449cbbfa5eab585657cdde811b34a92e1d17..c8385460701395cb5c65fba41335469f
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, worlds, eraseCache); WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, worlds, eraseCache);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 7bad75bd86fcb484e253fca8077d017d3161158b..fe83f13d71f84591f5506e1c6b9dfbf9fba680bd 100644 index cd65a5bb6da734a39b0bb6e9a0571455d19ceac4..fac993d58bd6e3bb19fd69881092a863c8952c65 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -193,6 +193,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -194,6 +194,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands(); org.spigotmc.SpigotConfig.registerCommands();
// Spigot end // Spigot end
@ -620,29 +620,21 @@ index 7bad75bd86fcb484e253fca8077d017d3161158b..fe83f13d71f84591f5506e1c6b9dfbf9
this.setPvpAllowed(dedicatedserverproperties.pvp); this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 16ca2a041139dd06922459df33e6eb058dbda3d2..cfe9930490489d506c91d174b5aad199314ffd17 100644 index 1ff471fb8a4f69f02debe9c40b13cc1e8b8045d7..9591f50922343283597bad6d9ac17c175d8ae230 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -23,6 +23,7 @@ import net.minecraft.core.BlockPos; @@ -334,6 +334,12 @@ public class ServerChunkCache extends ChunkSource {
import net.minecraft.core.SectionPos;
import net.minecraft.network.protocol.Packet;
import net.minecraft.server.level.progress.ChunkProgressListener;
+import net.minecraft.util.Mth;
import net.minecraft.util.VisibleForDebug;
import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.util.thread.BlockableEventLoop;
@@ -334,6 +335,12 @@ public class ServerChunkCache extends ChunkSource {
} }
} }
+ // Paper start - helper + // Paper start - helper
+ public boolean isPositionTicking(Entity entity) { + public boolean isPositionTicking(Entity entity) {
+ return this.isPositionTicking(ChunkPos.asLong(Mth.floor(entity.getX()) >> 4, Mth.floor(entity.getZ()) >> 4)); + return this.isPositionTicking(ChunkPos.asLong(net.minecraft.util.Mth.floor(entity.getX()) >> 4, net.minecraft.util.Mth.floor(entity.getZ()) >> 4));
+ } + }
+ // Paper end + // Paper end
+ +
public boolean isPositionTicking(long i) { public boolean isPositionTicking(long pos) {
return this.checkChunkFuture(i, (Function<ChunkHolder, CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>>>) ChunkHolder::getTickingChunkFuture); // CraftBukkit - decompile error return this.checkChunkFuture(pos, (Function<ChunkHolder, CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>>>) ChunkHolder::getTickingChunkFuture); // CraftBukkit - decompile error
} }
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be035e911e70 100644 index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be035e911e70 100644
@ -668,10 +660,10 @@ index 067216078c7b50390957d1fcfbfbaaeb81cfba21..7f3d83d3d071f6b441ad119b1c93be03
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e3297ceb4 100644 index 7f81dd05ec8945a851b6501854dc894cad240a66..d6b2e7d643f907ddd81d394d9b613e9ce93a786e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -146,6 +146,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -147,6 +147,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean populating; public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
@ -680,7 +672,7 @@ index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e
public final SpigotTimings.WorldTimingsHandler timings; // Spigot public final SpigotTimings.WorldTimingsHandler timings; // Spigot
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
@@ -166,6 +168,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -167,6 +169,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, final DimensionType dimensionmanager, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, final DimensionType dimensionmanager, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
@ -689,7 +681,7 @@ index b2083d26e3b239d0f26da77955db6a34b622a1bb..90854842fda0f91ac68c70efbcf8ad9e
this.world = new CraftWorld((ServerLevel) this, gen, env); this.world = new CraftWorld((ServerLevel) this, gen, env);
this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cb68f677221c0accb22c2c204f24bb4127a2b542..2bd19cf2ed4144b4f4403afc98fdb8e95f7c95cc 100644 index 1364a4a95e265c042880c99ea6b59dd2725b18ac..57a44f1d466caeccebe0e2498e3833cb953ffd5a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -805,6 +805,7 @@ public final class CraftServer implements Server { @@ -805,6 +805,7 @@ public final class CraftServer implements Server {

File diff suppressed because one or more lines are too long

View File

@ -2315,11 +2315,11 @@ index 3d374000cd61d4a29dae21035c5ee9a93a1ff0f9..e59475b7bb3e000afece0033c5d3f112
return NbtUtils.loadUUID(this.get(key)); return NbtUtils.loadUUID(this.get(key));
} }
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
index f189a72bd101a99d9350072a06953665fc5d6fee..83e99af925c87433b59f9bed30dfbf4e490c1b84 100644 index 5bcfbda6fd8bb8a3793ddad18f533f4f31f0bc94..8e9d685d04b93cef73b3fbebd086c970968914d5 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java --- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java
@@ -45,7 +45,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -45,7 +45,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
throw new IllegalArgumentException("Packet too big (is " + j + ", should be less than 2097152): " + packet); throw new IllegalArgumentException("Packet too big (is " + j + ", should be less than 8388608): " + packet);
} }
} catch (Throwable var9) { } catch (Throwable var9) {
- LOGGER.error(var9); - LOGGER.error(var9);
@ -2830,10 +2830,10 @@ index 0000000000000000000000000000000000000000..80f8d6ce6dd717d4b37b78539c65b6ac
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 75801343b14a5555e974168170af95f8513926f5..1b76d1b929b85b130639e7937a118342b568e795 100644 index b5f3bf8ff585c518326b0dcb5b793f181d52505f..571e57affcf81151550184b45934ae810885145f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -941,6 +941,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -949,6 +949,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
} }
// Spigot start // Spigot start
@ -3000,7 +3000,7 @@ index 6fa6fb852cd5af2009008ac6158251ba5e8cf6fb..24f72050229031898fd9da585ad2ceec
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214a54efc46 100644 index e9d2034f0753670c2ce69cc93c7e98e89af65c87..2b62f4664f439808661d559dc99762bfbac09b16 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket; @@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
@ -3038,7 +3038,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) { public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync); super(new File(session.getDimensionPath(world.dimension()), "region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone(); this.visibleChunkMap = this.updatingChunkMap.clone();
@@ -271,6 +292,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -273,6 +294,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
} }
@ -3053,7 +3053,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) { private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
List<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> list = Lists.newArrayList(); List<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> list = Lists.newArrayList();
int j = centerChunk.x; int j = centerChunk.x;
@@ -961,6 +990,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -962,6 +991,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag1) { if (!flag1) {
this.distanceManager.addPlayer(SectionPos.of((Entity) player), player); this.distanceManager.addPlayer(SectionPos.of((Entity) player), player);
} }
@ -3061,7 +3061,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
} else { } else {
SectionPos sectionposition = player.getLastSectionPos(); SectionPos sectionposition = player.getLastSectionPos();
@@ -968,6 +998,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -969,6 +999,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag2) { if (!flag2) {
this.distanceManager.removePlayer(sectionposition, player); this.distanceManager.removePlayer(sectionposition, player);
} }
@ -3069,7 +3069,7 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
} }
for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) { for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) {
@@ -1078,6 +1109,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1079,6 +1110,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
} }
@ -3079,10 +3079,10 @@ index a45d5c1156e84ab6e56c95e392fd52ea9ecebcb0..33d17e69fac035c421345e1a8c6eb214
@Override @Override
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465e879deaa 100644 index 9591f50922343283597bad6d9ac17c175d8ae230..8639ffa2347e3d5c44ab30de0aa98623f95d1fe7 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -45,6 +45,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana @@ -44,6 +44,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
import net.minecraft.world.level.storage.DimensionDataStorage; import net.minecraft.world.level.storage.DimensionDataStorage;
import net.minecraft.world.level.storage.LevelData; import net.minecraft.world.level.storage.LevelData;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
@ -3090,7 +3090,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465
public class ServerChunkCache extends ChunkSource { public class ServerChunkCache extends ChunkSource {
@@ -67,6 +68,158 @@ public class ServerChunkCache extends ChunkSource { @@ -66,6 +67,158 @@ public class ServerChunkCache extends ChunkSource {
@Nullable @Nullable
@VisibleForDebug @VisibleForDebug
private NaturalSpawner.SpawnState lastSpawnState; private NaturalSpawner.SpawnState lastSpawnState;
@ -3249,7 +3249,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, boolean flag, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<DimensionDataStorage> supplier) { public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, boolean flag, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<DimensionDataStorage> supplier) {
this.level = world; this.level = world;
@@ -128,6 +281,49 @@ public class ServerChunkCache extends ChunkSource { @@ -127,6 +280,49 @@ public class ServerChunkCache extends ChunkSource {
this.lastChunk[0] = chunk; this.lastChunk[0] = chunk;
} }
@ -3299,7 +3299,7 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465
@Nullable @Nullable
@Override @Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) { public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
@@ -426,10 +622,9 @@ public class ServerChunkCache extends ChunkSource { @@ -425,10 +621,9 @@ public class ServerChunkCache extends ChunkSource {
this.lastSpawnState = spawnercreature_d; this.lastSpawnState = spawnercreature_d;
this.level.getProfiler().pop(); this.level.getProfiler().pop();
@ -3313,8 +3313,17 @@ index cfe9930490489d506c91d174b5aad199314ffd17..508adf5df266365992f9ee64f6592465
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
if (optional.isPresent()) { if (optional.isPresent()) {
@@ -453,7 +648,7 @@ public class ServerChunkCache extends ChunkSource {
}
this.level.getProfiler().popPush("broadcast");
- list.forEach((playerchunk) -> {
+ this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no...
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error
Objects.requireNonNull(playerchunk);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index bde78718251f9deb439805d41cb05ac063042efc..bcfc6ea89aa3b1df92d2b181d1d23902859e2584 100644 index a1a4e4fe7b635c632a024f8591c44f20c2f16618..1e1908649a19fe067defe3c0d9c798a6a2988d82 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -9,6 +9,7 @@ import it.unimi.dsi.fastutil.longs.LongSet; @@ -9,6 +9,7 @@ import it.unimi.dsi.fastutil.longs.LongSet;
@ -3326,10 +3335,10 @@ index bde78718251f9deb439805d41cb05ac063042efc..bcfc6ea89aa3b1df92d2b181d1d23902
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2889d43857f418eb26600e78940dedc2b7c2b0f4..2b0d989119c9f69a68a6c1c69fb09dbbedd16716 100644 index 76a07bfb7aef66efb461f82c2a1d4651b6513248..504862eae87d4b58d9588b383993a44919d66759 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -228,6 +228,8 @@ public class ServerPlayer extends Player { @@ -229,6 +229,8 @@ public class ServerPlayer extends Player {
public Integer clientViewDistance; public Integer clientViewDistance;
// CraftBukkit end // CraftBukkit end
@ -3338,7 +3347,7 @@ index 2889d43857f418eb26600e78940dedc2b7c2b0f4..2b0d989119c9f69a68a6c1c69fb09dbb
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
this.chatVisibility = ChatVisiblity.FULL; this.chatVisibility = ChatVisiblity.FULL;
@@ -295,6 +297,8 @@ public class ServerPlayer extends Player { @@ -291,6 +293,8 @@ public class ServerPlayer extends Player {
this.maxUpStep = 1.0F; this.maxUpStep = 1.0F;
this.fudgeSpawnLocation(world); this.fudgeSpawnLocation(world);
@ -3391,10 +3400,10 @@ index 391bae98e542333a431fb48bf0675c0e8a1873ac..0f6b534a4c789a2f09f6c4624e5d58b9
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos); return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a401610e083b699be2c60a505f673cb3968d452b..e02562f8d0160dc3516768555604ae47f3f55461 100644 index 1130a8b5e3314d879319b8b60b2408b6c1aa7f5b..d6bef66d1cc0e3915ca5a9b9d5fc6e645eb5a7de 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -219,9 +219,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -218,9 +218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server; private final MinecraftServer server;
public ServerPlayer player; public ServerPlayer player;
private int tickCount; private int tickCount;
@ -3426,7 +3435,7 @@ index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a8
@Override @Override
public void tell(R runnable) { public void tell(R runnable) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b0e26859d 100644 index e6d003701426a823768966d944384c69b9701967..3b09f76805053802bb779e227749d81482636407 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity { @@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity {
@ -3438,10 +3447,10 @@ index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b
@Override @Override
public float getBukkitYaw() { public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 7ed0498e86fa5cea8edb002146126dcedd5b23f6..e91932d25e7b5d4a95e485bfa8b70632e0641b0a 100644 index 014a95cac1ad21637c21e2c0c9e189ff9e3b319d..6b4e78af38fe5b2567597d6267ddecd252585b5a 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -230,6 +230,7 @@ public abstract class Mob extends LivingEntity { @@ -231,6 +231,7 @@ public abstract class Mob extends LivingEntity {
return this.target; return this.target;
} }
@ -3475,7 +3484,7 @@ index d31c62b612a5a8016ffbfbb9dc85d9a941c08cf4..fc34cfa8bfb3b82a8e1b28d261f0e901
super(type, world); super(type, world);
this.xpReward = 5; this.xpReward = 5;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 48902f822ccb6e231201f888a2a92923a946e8cf..280519717d32385a74d6e942a6f42fc12ad8c57e 100644 index 17267d9d58ece0140171a297deb59dd54993135a..4a1ca04332e5afe0379276f3cefab7e0bf03a07b 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -725,6 +725,24 @@ public final class ItemStack { @@ -725,6 +725,24 @@ public final class ItemStack {
@ -3503,7 +3512,7 @@ index 48902f822ccb6e231201f888a2a92923a946e8cf..280519717d32385a74d6e942a6f42fc1
public void setTag(@Nullable CompoundTag tag) { public void setTag(@Nullable CompoundTag tag) {
this.tag = tag; this.tag = tag;
if (this.getItem().canBeDepleted()) { if (this.getItem().canBeDepleted()) {
@@ -1128,6 +1146,7 @@ public final class ItemStack { @@ -1125,6 +1143,7 @@ public final class ItemStack {
// CraftBukkit start // CraftBukkit start
@Deprecated @Deprecated
public void setItem(Item item) { public void setItem(Item item) {
@ -3613,7 +3622,7 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..c7d499bfc22152e0a49f50a2a8133f31
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f21610899d97 100644 index d6b2e7d643f907ddd81d394d9b613e9ce93a786e..3286beed6bf79f5f6b91227f596fcc43200e8bda 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -84,6 +84,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -84,6 +84,7 @@ import org.bukkit.craftbukkit.CraftServer;
@ -3624,7 +3633,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.block.BlockPhysicsEvent;
@@ -228,9 +229,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -229,9 +230,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
Level.this.getCraftServer().getHandle().sendAll(new ClientboundSetBorderWarningDistancePacket(border), border.world); Level.this.getCraftServer().getHandle().sendAll(new ClientboundSetBorderWarningDistancePacket(border), border.world);
} }
@ -3638,7 +3647,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216
}); });
// CraftBukkit end // CraftBukkit end
this.timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings this.timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings
@@ -265,18 +268,50 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -266,18 +269,50 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return y < -20000000 || y >= 20000000; return y < -20000000 || y >= 20000000;
} }
@ -3693,7 +3702,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create); ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
if (ichunkaccess == null && create) { if (ichunkaccess == null && create) {
@@ -287,7 +322,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -288,7 +323,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
@Override @Override
@ -3702,7 +3711,7 @@ index 90854842fda0f91ac68c70efbcf8ad9e3297ceb4..e9dc71fb74698b2f11220e4eb379f216
return this.setBlock(pos, state, flags, 512); return this.setBlock(pos, state, flags, 512);
} }
@@ -588,7 +623,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -593,7 +628,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (this.isOutsideBuildHeight(pos)) { if (this.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState(); return Blocks.VOID_AIR.defaultBlockState();
} else { } else {

View File

@ -767,10 +767,10 @@ index b3a6aeba2363d283f03982cf749f25cfa11a5052..449f1b2f5dca350dc0912e14c8c2bf3e
PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet); PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b403ef2dff6 100644 index 571e57affcf81151550184b45934ae810885145f..fcc775723bcef7c6b740ee332c21ef70e591c77e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -183,7 +183,7 @@ import org.bukkit.craftbukkit.Main; @@ -180,7 +180,7 @@ import org.bukkit.craftbukkit.Main;
import org.bukkit.event.server.ServerLoadEvent; import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end // CraftBukkit end
@ -779,7 +779,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
import org.spigotmc.SlackActivityAccountant; // Spigot import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable {
@@ -887,6 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -895,6 +895,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// CraftBukkit end // CraftBukkit end
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");
@ -787,7 +787,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@@ -1089,9 +1090,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1097,9 +1098,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean haveTime() { private boolean haveTime() {
// CraftBukkit start // CraftBukkit start
@ -809,7 +809,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
private void executeModerately() { private void executeModerately() {
this.runAllTasks(); this.runAllTasks();
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
@@ -1099,9 +1112,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1107,9 +1120,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end // CraftBukkit end
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
@ -821,7 +821,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
}); });
} }
@@ -1193,10 +1206,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1195,10 +1208,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {} public void onServerExit() {}
public void tickServer(BooleanSupplier shouldKeepTicking) { public void tickServer(BooleanSupplier shouldKeepTicking) {
@ -841,7 +841,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
++this.tickCount; ++this.tickCount;
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
@@ -1214,14 +1235,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1216,14 +1237,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@ -856,7 +856,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
} }
this.profiler.push("snooper"); this.profiler.push("snooper");
@@ -1234,6 +1253,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1236,6 +1255,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.pop(); this.profiler.pop();
@ -870,7 +870,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
this.profiler.push("tallying"); this.profiler.push("tallying");
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1244,30 +1270,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1246,30 +1272,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
this.slackActivityAccountant.tickEnded(l); // Spigot this.slackActivityAccountant.tickEnded(l); // Spigot
@ -909,7 +909,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) { if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -1275,7 +1300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1277,7 +1302,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
} }
} }
@ -918,7 +918,7 @@ index 1b76d1b929b85b130639e7937a118342b568e795..bf26abaf0d3567026da3e95712583b40
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -1316,24 +1341,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1318,24 +1343,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.popPush("connection"); this.profiler.popPush("connection");
@ -963,10 +963,10 @@ index b0ff982603e61805e3a0426aa8376330c73d9cf4..cf711f7fecdab70ff2ee48c87a3a1f08
i = this.context.runTopCommand(function, source); i = this.context.runTopCommand(function, source);
} finally { } finally {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28af5453701 100644 index fac993d58bd6e3bb19fd69881092a863c8952c65..2b062beaad39f2e86801fdd5b0cc84b253f1348a 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -66,8 +66,9 @@ import org.apache.logging.log4j.Logger; @@ -67,8 +67,9 @@ import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.io.IoBuilder; import org.apache.logging.log4j.io.IoBuilder;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -977,7 +977,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
import org.bukkit.event.server.RemoteServerCommandEvent; import org.bukkit.event.server.RemoteServerCommandEvent;
// CraftBukkit end // CraftBukkit end
@@ -465,7 +466,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -467,7 +468,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
public void handleConsoleInputs() { public void handleConsoleInputs() {
@ -986,7 +986,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
while (!this.consoleInput.isEmpty()) { while (!this.consoleInput.isEmpty()) {
ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0); ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0);
@@ -480,7 +481,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -482,7 +483,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// CraftBukkit end // CraftBukkit end
} }
@ -995,7 +995,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
} }
@Override @Override
@@ -711,6 +712,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -713,6 +714,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override @Override
public String runCommand(String command) { public String runCommand(String command) {
@ -1003,7 +1003,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
this.rconConsoleSource.prepareForCommand(); this.rconConsoleSource.prepareForCommand();
this.executeBlocking(() -> { this.executeBlocking(() -> {
// CraftBukkit start - fire RemoteServerCommandEvent // CraftBukkit start - fire RemoteServerCommandEvent
@@ -719,10 +721,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -721,10 +723,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }
@ -1044,7 +1044,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bce50dc3c2 100644 index 2b62f4664f439808661d559dc99762bfbac09b16..4788946d7fb25c1b0f26e6a038924c4a62978d53 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
@ -1057,7 +1057,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Queues; import com.google.common.collect.Queues;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -579,11 +581,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -580,11 +582,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos pos) { private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos pos) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
@ -1075,7 +1075,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
boolean flag = nbttagcompound.contains("Level", 10) && nbttagcompound.getCompound("Level").contains("Status", 8); boolean flag = nbttagcompound.contains("Level", 10) && nbttagcompound.getCompound("Level").contains("Status", 8);
if (flag) { if (flag) {
@@ -594,7 +599,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -595,7 +600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos); ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos);
@ -1084,7 +1084,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
} catch (ReportedException reportedexception) { } catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause(); Throwable throwable = reportedexception.getCause();
@@ -708,6 +713,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -709,6 +714,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = ChunkHolder.getStatus(playerchunk.getTicketLevel()); ChunkStatus chunkstatus = ChunkHolder.getStatus(playerchunk.getTicketLevel());
return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> { return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> {
@ -1092,7 +1092,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
ChunkPos chunkcoordintpair = playerchunk.getPos(); ChunkPos chunkcoordintpair = playerchunk.getPos();
ProtoChunk protochunk = (ProtoChunk) ichunkaccess; ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
LevelChunk chunk; LevelChunk chunk;
@@ -731,6 +737,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -732,6 +738,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
return chunk; return chunk;
@ -1100,7 +1100,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
}); });
}, (runnable) -> { }, (runnable) -> {
ProcessorHandle mailbox = this.mainThreadMailbox; ProcessorHandle mailbox = this.mainThreadMailbox;
@@ -1188,6 +1195,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1189,6 +1196,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkMap.TrackedEntity playerchunkmap_entitytracker; ChunkMap.TrackedEntity playerchunkmap_entitytracker;
ObjectIterator objectiterator; ObjectIterator objectiterator;
@ -1108,7 +1108,7 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
for (objectiterator = this.entityMap.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.serverEntity.sendChanges()) { for (objectiterator = this.entityMap.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.serverEntity.sendChanges()) {
playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next(); playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next();
@@ -1205,16 +1213,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1206,16 +1214,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.lastSectionPos = sectionposition1; playerchunkmap_entitytracker.lastSectionPos = sectionposition1;
} }
} }
@ -1130,10 +1130,10 @@ index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bc
public void broadcast(Entity entity, Packet<?> packet) { public void broadcast(Entity entity, Packet<?> packet) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029eefdbb090 100644 index 1bb7faf3b25e4a0dd1407c8e9b33cd7afa2c149e..672c6651043a4efd65e472bbd519f54861ec008a 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -349,13 +349,15 @@ public class ServerChunkCache extends ChunkSource { @@ -348,13 +348,15 @@ public class ServerChunkCache extends ChunkSource {
} }
gameprofilerfiller.incrementCounter("getChunkCacheMiss"); gameprofilerfiller.incrementCounter("getChunkCacheMiss");
@ -1151,7 +1151,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1; return ichunkaccess1;
}, (playerchunk_failure) -> { }, (playerchunk_failure) -> {
@@ -555,7 +557,9 @@ public class ServerChunkCache extends ChunkSource { @@ -554,7 +556,9 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) { public void save(boolean flush) {
this.runDistanceManagerUpdates(); this.runDistanceManagerUpdates();
@ -1161,7 +1161,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
} }
@Override @Override
@@ -593,7 +597,9 @@ public class ServerChunkCache extends ChunkSource { @@ -592,7 +596,9 @@ public class ServerChunkCache extends ChunkSource {
this.runDistanceManagerUpdates(); this.runDistanceManagerUpdates();
this.level.timings.doChunkMap.stopTiming(); // Spigot this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks"); this.level.getProfiler().popPush("chunks");
@ -1171,7 +1171,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
this.level.timings.doChunkUnload.startTiming(); // Spigot this.level.timings.doChunkUnload.startTiming(); // Spigot
this.level.getProfiler().popPush("unload"); this.level.getProfiler().popPush("unload");
this.chunkMap.tick(booleansupplier); this.chunkMap.tick(booleansupplier);
@@ -617,13 +623,16 @@ public class ServerChunkCache extends ChunkSource { @@ -616,13 +622,16 @@ public class ServerChunkCache extends ChunkSource {
boolean flag2 = level.ticksPerAnimalSpawns != 0L && worlddata.getGameTime() % level.ticksPerAnimalSpawns == 0L; // CraftBukkit boolean flag2 = level.ticksPerAnimalSpawns != 0L && worlddata.getGameTime() % level.ticksPerAnimalSpawns == 0L; // CraftBukkit
this.level.getProfiler().push("naturalSpawnCount"); this.level.getProfiler().push("naturalSpawnCount");
@ -1188,17 +1188,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no...
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
@@ -631,7 +640,9 @@ public class ServerChunkCache extends ChunkSource { @@ -636,15 +645,18 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().push("broadcast");
LevelChunk chunk = (LevelChunk) optional.get();
+ this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
playerchunk.broadcastChanges(chunk);
+ this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
this.level.getProfiler().pop();
ChunkPos chunkcoordintpair = chunk.getPos();
@@ -641,24 +652,25 @@ public class ServerChunkCache extends ChunkSource {
NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag2); NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag2);
} }
@ -1218,6 +1208,21 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
+ } // Paper - timings + } // Paper - timings
} }
this.level.getProfiler().popPush("broadcast");
@@ -652,15 +664,20 @@ public class ServerChunkCache extends ChunkSource {
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); // CraftBukkit - decompile error
Objects.requireNonNull(playerchunk);
- optional.ifPresent(playerchunk::broadcastChanges);
+
+ // Paper start - timings
+ optional.ifPresent(chunk -> {
+ this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
+ playerchunk.broadcastChanges(chunk);
+ this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
+ });
+ // Paper end
});
this.level.getProfiler().pop(); this.level.getProfiler().pop();
this.level.getProfiler().pop(); this.level.getProfiler().pop();
} }
@ -1229,7 +1234,7 @@ index 508adf5df266365992f9ee64f6592465e879deaa..eeb43a243bfab978e17fd4f2f052029e
private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) { private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274fa38d85f 100644 index 1e1908649a19fe067defe3c0d9c798a6a2988d82..1ec05701b0a1d6f6ecd17b2830a7c074675253dd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
@ -1268,10 +1273,6 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274
@@ -469,17 +470,21 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -469,17 +470,21 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
this.updateSkyBrightness(); this.updateSkyBrightness();
this.tickTime(); this.tickTime();
gameprofilerfiller.popPush("chunkSource");
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings
this.getChunkSource().tick(shouldKeepTicking);
+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings
gameprofilerfiller.popPush("tickPending"); gameprofilerfiller.popPush("tickPending");
- timings.doTickPending.startTiming(); // Spigot - timings.doTickPending.startTiming(); // Spigot
+ timings.scheduledBlocks.startTiming(); // Paper + timings.scheduledBlocks.startTiming(); // Paper
@ -1286,6 +1287,10 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274
+ this.timings.raids.startTiming(); // Paper - timings + this.timings.raids.startTiming(); // Paper - timings
this.raids.tick(); this.raids.tick();
+ this.timings.raids.stopTiming(); // Paper - timings + this.timings.raids.stopTiming(); // Paper - timings
gameprofilerfiller.popPush("chunkSource");
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings
this.getChunkSource().tick(shouldKeepTicking);
+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings
gameprofilerfiller.popPush("blockEvents"); gameprofilerfiller.popPush("blockEvents");
timings.doSounds.startTiming(); // Spigot timings.doSounds.startTiming(); // Spigot
this.runBlockEvents(); this.runBlockEvents();
@ -1360,10 +1365,10 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274
this.entityManager.saveAll(); this.entityManager.saveAll();
} else { } else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942 100644 index d6bef66d1cc0e3915ca5a9b9d5fc6e645eb5a7de..401520c47e63c3d2055e320daaeb1e74b1f627e1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -209,6 +209,7 @@ import org.bukkit.inventory.EquipmentSlot; @@ -208,6 +208,7 @@ import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.SmithingInventory; import org.bukkit.inventory.SmithingInventory;
import org.bukkit.util.NumberConversions; import org.bukkit.util.NumberConversions;
@ -1371,7 +1376,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
// CraftBukkit end // CraftBukkit end
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener { public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener {
@@ -288,7 +289,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -287,7 +288,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end // CraftBukkit end
public void tick() { public void tick() {
@ -1379,7 +1384,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
this.resetPosition(); this.resetPosition();
this.player.xo = this.player.getX(); this.player.xo = this.player.getX();
this.player.yo = this.player.getY(); this.player.yo = this.player.getY();
@@ -364,7 +364,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -363,7 +363,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling")); this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling"));
} }
@ -1387,7 +1392,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
} }
@@ -1922,7 +1921,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1909,7 +1908,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end // CraftBukkit end
private void handleCommand(String input) { private void handleCommand(String input) {
@ -1396,7 +1401,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
// CraftBukkit start - whole method // CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input); this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input);
@@ -1933,7 +1932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1920,7 +1919,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@ -1405,7 +1410,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
return; return;
} }
@@ -1946,7 +1945,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1933,7 +1932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return; return;
} finally { } finally {
@ -1415,7 +1420,7 @@ index 4c03678894cc23905634288e86906af4c939aac2..cf9cc3ef64ec95e1061fc109e7268c2b
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s); // this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac3664888b1b35c 100644 index 8c4744b3a3ebf73d31f59d1566320031550aa3bb..c731f22390773bcd43d392b86ae5b42b0da27c1f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -1425,7 +1430,7 @@ index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac36648
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1008,10 +1009,11 @@ public abstract class PlayerList { @@ -1010,10 +1011,11 @@ public abstract class PlayerList {
} }
public void saveAll() { public void saveAll() {
@ -1439,7 +1444,7 @@ index 809b8510d638cc66ca0a72f88edd68e917dbbf26..524428ee32d18c76c0e9c46bbac36648
public UserWhiteList getWhiteList() { public UserWhiteList getWhiteList() {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 430d286a73cfdd643e85bdaa97bf91c2c74a342c..0b63d81ecbcb56bf3dc25661cc2b219cd8c25592 100644 index 0b13a1464a9e6c4912e737879b00ae14da99fbf5..e21f83ca4520da2e518950de5f8bc84d666158e6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -126,7 +126,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -126,7 +126,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent;
@ -1538,7 +1543,7 @@ index 7f3d83d3d071f6b441ad119b1c93be035e911e70..8d5c61a77bea2f2f5dbff26cb479f855
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952d9a6661c 100644 index 3b09f76805053802bb779e227749d81482636407..759cd74cda7f0d1f3c0f3bc0a2a941e16258a1c0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -1550,7 +1555,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
public abstract class LivingEntity extends Entity { public abstract class LivingEntity extends Entity {
@@ -2758,7 +2758,6 @@ public abstract class LivingEntity extends Entity { @@ -2761,7 +2761,6 @@ public abstract class LivingEntity extends Entity {
@Override @Override
public void tick() { public void tick() {
@ -1558,7 +1563,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
super.tick(); super.tick();
this.updatingUsingItem(); this.updatingUsingItem();
this.updateSwimAmount(); this.updateSwimAmount();
@@ -2799,9 +2798,7 @@ public abstract class LivingEntity extends Entity { @@ -2802,9 +2801,7 @@ public abstract class LivingEntity extends Entity {
} }
} }
@ -1568,7 +1573,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
double d0 = this.getX() - this.xo; double d0 = this.getX() - this.xo;
double d1 = this.getZ() - this.zo; double d1 = this.getZ() - this.zo;
float f = (float) (d0 * d0 + d1 * d1); float f = (float) (d0 * d0 + d1 * d1);
@@ -2881,8 +2878,6 @@ public abstract class LivingEntity extends Entity { @@ -2884,8 +2881,6 @@ public abstract class LivingEntity extends Entity {
if (this.isSleeping()) { if (this.isSleeping()) {
this.setXRot(0.0F); this.setXRot(0.0F);
} }
@ -1577,7 +1582,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
} }
public void detectEquipmentUpdates() { public void detectEquipmentUpdates() {
@@ -3064,7 +3059,6 @@ public abstract class LivingEntity extends Entity { @@ -3067,7 +3062,6 @@ public abstract class LivingEntity extends Entity {
this.setDeltaMovement(d4, d5, d6); this.setDeltaMovement(d4, d5, d6);
this.level.getProfiler().push("ai"); this.level.getProfiler().push("ai");
@ -1585,7 +1590,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
if (this.isImmobile()) { if (this.isImmobile()) {
this.jumping = false; this.jumping = false;
this.xxa = 0.0F; this.xxa = 0.0F;
@@ -3074,7 +3068,6 @@ public abstract class LivingEntity extends Entity { @@ -3077,7 +3071,6 @@ public abstract class LivingEntity extends Entity {
this.serverAiStep(); this.serverAiStep();
this.level.getProfiler().pop(); this.level.getProfiler().pop();
} }
@ -1593,7 +1598,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
this.level.getProfiler().pop(); this.level.getProfiler().pop();
this.level.getProfiler().push("jump"); this.level.getProfiler().push("jump");
@@ -3109,9 +3102,9 @@ public abstract class LivingEntity extends Entity { @@ -3112,9 +3105,9 @@ public abstract class LivingEntity extends Entity {
this.updateFallFlying(); this.updateFallFlying();
AABB axisalignedbb = this.getBoundingBox(); AABB axisalignedbb = this.getBoundingBox();
@ -1605,7 +1610,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
this.level.getProfiler().pop(); this.level.getProfiler().pop();
this.level.getProfiler().push("freezing"); this.level.getProfiler().push("freezing");
boolean flag1 = this.getType().is((Tag) EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); boolean flag1 = this.getType().is((Tag) EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
@@ -3140,9 +3133,7 @@ public abstract class LivingEntity extends Entity { @@ -3143,9 +3136,7 @@ public abstract class LivingEntity extends Entity {
this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
} }
@ -1616,7 +1621,7 @@ index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
this.hurt(DamageSource.DROWN, 1.0F); this.hurt(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6376e243c 100644 index 3286beed6bf79f5f6b91227f596fcc43200e8bda..e38cd4df0924cce7fee4fd98967990945a62ecf4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -82,7 +82,6 @@ import org.bukkit.Bukkit; @@ -82,7 +82,6 @@ import org.bukkit.Bukkit;
@ -1627,7 +1632,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6
import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CapturedBlockState;
import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -149,7 +148,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -150,7 +149,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
@ -1636,7 +1641,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
@@ -236,7 +235,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -237,7 +236,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
}); });
// CraftBukkit end // CraftBukkit end
@ -1645,7 +1650,7 @@ index e9dc71fb74698b2f11220e4eb379f21610899d97..26f19bd01425e62f825cc51fded953d6
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
} }
@@ -720,15 +719,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -725,15 +724,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
timings.tileEntityTick.stopTiming(); // Spigot timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false; this.tickingBlockEntities = false;
@ -1716,7 +1721,7 @@ index 0be0c9a9f29f29e2622df49861d30a7edbaf0515..702203f4a4fa4fc03c35ec974a97e08e
this.alreadyTicked.clear(); this.alreadyTicked.clear();
this.currentlyTicking.clear(); this.currentlyTicking.clear();
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 198c1092e7db6e0023df77e4707c376696fdbafd..c27e755f93a2b2e203b305e0cae2c782a34e38cc 100644 index 0cd5448d93091e981374b0c11e95a3baca9defef..72ef08a59dbf72bec2ce54ab76455c4230395959 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -90,6 +90,15 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -90,6 +90,15 @@ public class Block extends BlockBehaviour implements ItemLike {
@ -1774,7 +1779,7 @@ index 0d0f721fe80c52d92d91843ae9970c5fd55ca143..3e2bc640a06667f0d4f3c2367ac79451
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index 468b67babc628f7ff7c6fa138ed7944a8d77f0a6..22d5c4cc3aea19cbf53ea320765ecceb4daf7428 100644 index b645a2fc839dbf922ce73b23b7d53e9a5fe1a2ee..1b478ebfe6792a157772a5812d0daa1a3ccc4776 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -1812,7 +1817,7 @@ index 468b67babc628f7ff7c6fa138ed7944a8d77f0a6..22d5c4cc3aea19cbf53ea320765ecceb
private static CompoundTag packStructureData(ServerLevel world, ChunkPos chunkcoordintpair, Map<StructureFeature<?>, StructureStart<?>> map, Map<StructureFeature<?>, LongSet> map1) { private static CompoundTag packStructureData(ServerLevel world, ChunkPos chunkcoordintpair, Map<StructureFeature<?>, StructureStart<?>> map, Map<StructureFeature<?>, LongSet> map1) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2bd19cf2ed4144b4f4403afc98fdb8e95f7c95cc..fe1b05555d36f7082a66b9ebd6261b91919aa081 100644 index 57a44f1d466caeccebe0e2498e3833cb953ffd5a..878af195b64b7c25cb7ef130846d30aea2474897 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2083,12 +2083,31 @@ public final class CraftServer implements Server { @@ -2083,12 +2083,31 @@ public final class CraftServer implements Server {
@ -2212,7 +2217,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
this.value = value; this.value = value;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 456f0e9e827f61ebdcb42dbc00f5d374e318597f..0f0ffedd2cc3cf1b30b338d8ae3a8ad388dfde53 100644 index 67cae2e6055389e93fb4b94daf8402ec5fdc6f9a..7a3ba7590249d6a3eb37f894c9cfd414a8ccf3fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -156,6 +156,12 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -156,6 +156,12 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -981,7 +981,7 @@ index b82b218be1bd849fa280ea1fe0336e279bebfc18..2fb444653118816f1250841cb4c6c486
public static ChatFormatting getById(int colorIndex) { public static ChatFormatting getById(int colorIndex) {
if (colorIndex < 0) { if (colorIndex < 0) {
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d8689d9381a 100644 index ca4d629616136e3362c872c3d10cba67c8225c8c..22bc8fa039375a3205bdfdf05b6c73c856fb1b16 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException; @@ -14,6 +14,7 @@ import io.netty.handler.codec.EncoderException;
@ -992,7 +992,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.IOException; import java.io.IOException;
@@ -61,6 +62,7 @@ public class FriendlyByteBuf extends ByteBuf { @@ -62,6 +63,7 @@ public class FriendlyByteBuf extends ByteBuf {
private static final int MAX_VARLONG_SIZE = 10; private static final int MAX_VARLONG_SIZE = 10;
private static final int DEFAULT_NBT_QUOTA = 2097152; private static final int DEFAULT_NBT_QUOTA = 2097152;
private final ByteBuf source; private final ByteBuf source;
@ -1000,7 +1000,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86
public static final short MAX_STRING_LENGTH = 32767; public static final short MAX_STRING_LENGTH = 32767;
public static final int MAX_COMPONENT_STRING_LENGTH = 262144; public static final int MAX_COMPONENT_STRING_LENGTH = 262144;
@@ -326,8 +328,15 @@ public class FriendlyByteBuf extends ByteBuf { @@ -351,8 +353,15 @@ public class FriendlyByteBuf extends ByteBuf {
return Component.Serializer.fromJson(this.readUtf(262144)); return Component.Serializer.fromJson(this.readUtf(262144));
} }
@ -1018,7 +1018,7 @@ index 0ae24c8080391410756f101a1e40c2eef887c739..cbc968d0d514f01b26888f3ff8264d86
public <T extends Enum<T>> T readEnum(Class<T> enumClass) { public <T extends Enum<T>> T readEnum(Class<T> enumClass) {
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
index 83e99af925c87433b59f9bed30dfbf4e490c1b84..b8a0c0411fd2caab21672de7f3e721645b61a8ba 100644 index 8e9d685d04b93cef73b3fbebd086c970968914d5..092d8ecf8d6a7045d2fc379bc0f9ec4ee294d056 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java --- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java
@@ -3,6 +3,7 @@ package net.minecraft.network; @@ -3,6 +3,7 @@ package net.minecraft.network;
@ -1191,10 +1191,10 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490
buf.writeComponent(this.footer); buf.writeComponent(this.footer);
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e6d8e511a 100644 index 504862eae87d4b58d9588b383993a44919d66759..a8a0f65d99ed062467e50a79349dc6b56f325709 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -145,6 +145,7 @@ import net.minecraft.world.scores.Score; @@ -146,6 +146,7 @@ import net.minecraft.world.scores.Score;
import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.Team; import net.minecraft.world.scores.Team;
import net.minecraft.world.scores.criteria.ObjectiveCriteria; import net.minecraft.world.scores.criteria.ObjectiveCriteria;
@ -1202,7 +1202,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@@ -216,6 +217,7 @@ public class ServerPlayer extends Player { @@ -217,6 +218,7 @@ public class ServerPlayer extends Player {
// CraftBukkit start // CraftBukkit start
public String displayName; public String displayName;
@ -1210,7 +1210,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
public Component listName; public Component listName;
public org.bukkit.Location compassTarget; public org.bukkit.Location compassTarget;
public int newExp = 0; public int newExp = 0;
@@ -301,6 +303,7 @@ public class ServerPlayer extends Player { @@ -297,6 +299,7 @@ public class ServerPlayer extends Player {
// CraftBukkit start // CraftBukkit start
this.displayName = this.getScoreboardName(); this.displayName = this.getScoreboardName();
@ -1218,7 +1218,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
this.bukkitPickUpLoot = true; this.bukkitPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth(); this.maxHealthCache = this.getMaxHealth();
} }
@@ -736,23 +739,17 @@ public class ServerPlayer extends Player { @@ -732,23 +735,17 @@ public class ServerPlayer extends Player {
Component defaultMessage = this.getCombatTracker().getDeathMessage(); Component defaultMessage = this.getCombatTracker().getDeathMessage();
@ -1246,7 +1246,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
this.connection.send((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> { this.connection.send((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> {
if (!future.isSuccess()) { if (!future.isSuccess()) {
@@ -1702,6 +1699,7 @@ public class ServerPlayer extends Player { @@ -1698,6 +1695,7 @@ public class ServerPlayer extends Player {
} }
public String locale = "en_us"; // CraftBukkit - add, lowercase public String locale = "en_us"; // CraftBukkit - add, lowercase
@ -1254,7 +1254,7 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
public void updateOptions(ServerboundClientInformationPacket packet) { public void updateOptions(ServerboundClientInformationPacket packet) {
// CraftBukkit start // CraftBukkit start
if (getMainArm() != packet.getMainHand()) { if (getMainArm() != packet.getMainHand()) {
@@ -1713,6 +1711,10 @@ public class ServerPlayer extends Player { @@ -1709,6 +1707,10 @@ public class ServerPlayer extends Player {
this.server.server.getPluginManager().callEvent(event); this.server.server.getPluginManager().callEvent(event);
} }
this.locale = packet.language; this.locale = packet.language;
@ -1266,10 +1266,10 @@ index ee9eefc6ed85aea4801b5588e797a247fc747c49..fff24cae9cbde5e0ca417ea368f8572e
// CraftBukkit end // CraftBukkit end
this.chatVisibility = packet.getChatVisibility(); this.chatVisibility = packet.getChatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91166597f9 100644 index 401520c47e63c3d2055e320daaeb1e74b1f627e1..da9f4b3337b49597c17b50964656457cd629a0b7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -162,6 +162,8 @@ import org.apache.logging.log4j.LogManager; @@ -161,6 +161,8 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
// CraftBukkit start // CraftBukkit start
@ -1278,7 +1278,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
@@ -385,21 +387,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -384,21 +386,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return this.server.isSingleplayerOwner(this.player.getGameProfile()); return this.server.isSingleplayerOwner(this.player.getGameProfile());
} }
@ -1311,7 +1311,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
if (this.cserver.getServer().isRunning()) { if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
@@ -410,8 +415,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -409,8 +414,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return; return;
} }
// Send the possibly modified leave message // Send the possibly modified leave message
@ -1321,7 +1321,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
// CraftBukkit end // CraftBukkit end
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> { this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
@@ -1672,9 +1676,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1659,9 +1663,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
*/ */
this.player.disconnect(); this.player.disconnect();
@ -1336,7 +1336,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
} }
// CraftBukkit end // CraftBukkit end
this.player.getTextFilter().leave(); this.player.getTextFilter().leave();
@@ -1856,7 +1862,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1843,7 +1849,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.handleCommand(s); this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
@ -1350,7 +1350,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
Player player = this.getCraftPlayer(); Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
@@ -2646,30 +2657,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2634,30 +2645,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return; return;
} }
@ -1389,7 +1389,7 @@ index cf9cc3ef64ec95e1061fc109e7268c2b4bb1b942..4fc871595a2449cb22bceb8ed279fe91
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index e61752f3d00c6e2324745b92c880ee494f366765..75118458840caadfa82aa0fa2efd8a753b585ef2 100644 index 829ebf802b377cc811bf5af8c16aaa6d3a72a51d..c8d8d766de86dc3e47b06a355b28d2279820c570 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -36,6 +36,7 @@ import net.minecraft.world.entity.player.Player; @@ -36,6 +36,7 @@ import net.minecraft.world.entity.player.Player;
@ -1438,7 +1438,7 @@ index b632280e057ae6893bf5ebcde75cefac3ee62a09..9baa56d6da9c24706f1dbc8851fd68ca
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4b1d8041c 100644 index c731f22390773bcd43d392b86ae5b42b0da27c1f..14cf49b910bd789f1dd61d303b88d53a93c3abd6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile; @@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile;
@ -1448,8 +1448,8 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
+import io.papermc.paper.adventure.PaperAdventure; +import io.papermc.paper.adventure.PaperAdventure;
import java.io.File; import java.io.File;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.text.SimpleDateFormat; import java.nio.file.Path;
@@ -89,6 +90,7 @@ import org.apache.logging.log4j.LogManager; @@ -91,6 +92,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
// CraftBukkit start // CraftBukkit start
@ -1457,7 +1457,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServer;
@@ -256,7 +258,7 @@ public abstract class PlayerList { @@ -258,7 +260,7 @@ public abstract class PlayerList {
} }
// CraftBukkit start // CraftBukkit start
chatmessage.withStyle(ChatFormatting.YELLOW); chatmessage.withStyle(ChatFormatting.YELLOW);
@ -1466,7 +1466,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
this.players.add(player); this.players.add(player);
@@ -270,19 +272,18 @@ public abstract class PlayerList { @@ -272,19 +274,18 @@ public abstract class PlayerList {
// Ensure that player inventory is populated with its viewer // Ensure that player inventory is populated with its viewer
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
@ -1491,7 +1491,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
} }
// CraftBukkit end // CraftBukkit end
@@ -479,7 +480,7 @@ public abstract class PlayerList { @@ -481,7 +482,7 @@ public abstract class PlayerList {
} }
@ -1500,7 +1500,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
ServerLevel worldserver = entityplayer.getLevel(); ServerLevel worldserver = entityplayer.getLevel();
entityplayer.awardStat(Stats.LEAVE_GAME); entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -490,7 +491,7 @@ public abstract class PlayerList { @@ -492,7 +493,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(); entityplayer.closeContainer();
} }
@ -1509,7 +1509,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
this.cserver.getPluginManager().callEvent(playerQuitEvent); this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
@@ -543,7 +544,7 @@ public abstract class PlayerList { @@ -545,7 +546,7 @@ public abstract class PlayerList {
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end // CraftBukkit end
@ -1518,7 +1518,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
} }
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -589,10 +590,10 @@ public abstract class PlayerList { @@ -591,10 +592,10 @@ public abstract class PlayerList {
} }
// return chatmessage; // return chatmessage;
@ -1531,7 +1531,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
@@ -602,17 +603,17 @@ public abstract class PlayerList { @@ -604,17 +605,17 @@ public abstract class PlayerList {
} }
// return chatmessage; // return chatmessage;
@ -1552,7 +1552,7 @@ index 524428ee32d18c76c0e9c46bbac3664888b1b35c..186c745401a3320432f4aadfadfc6ef4
return null; return null;
} }
return entity; return entity;
@@ -1115,7 +1116,7 @@ public abstract class PlayerList { @@ -1117,7 +1118,7 @@ public abstract class PlayerList {
public void removeAll() { public void removeAll() {
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
@ -1671,7 +1671,7 @@ index 7a0e7961df1e62b311ea2ecc76d7343a8646723b..6859fafa42527d45366018f737c19e6c
} }
collection = icons; collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fe1b05555d36f7082a66b9ebd6261b91919aa081..255e338288eca828edf81d213c16fa84769f2038 100644 index 878af195b64b7c25cb7ef130846d30aea2474897..d6cb58d5c5f6d2f4aa769f4338ba63b2d55dc971 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -564,8 +564,10 @@ public final class CraftServer implements Server { @@ -564,8 +564,10 @@ public final class CraftServer implements Server {
@ -2076,7 +2076,7 @@ index 78d1621c1b5f1870829d92720e2151e9f9d9a8b5..6722d97d498fb2951b7dd8af3b68dd77
public void setCustomName(String name) { public void setCustomName(String name) {
// sane limit for name length // sane limit for name length
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index d4ea706d5456e709b95e34be8220a0d39be2c8f4..2db149bf57c561d7f8f49341fbefafb5d3ecab54 100644 index 042691349dd5659e8db526199641cbcfa21c6005..841dbf4a86b19d7c8ea41930ecb1f88c660fa117 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -317,9 +317,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -317,9 +317,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -2110,7 +2110,7 @@ index d4ea706d5456e709b95e34be8220a0d39be2c8f4..2db149bf57c561d7f8f49341fbefafb5
player.initMenu(container); player.initMenu(container);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af161cafd9b 100644 index 969d5071dbf3356b80da38526351d488ab936c08..d72354a670ad41b3dba8a7ffe8bc64bb8569d15c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -244,14 +244,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -244,14 +244,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -2292,7 +2292,7 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1
@Override @Override
public int getPing() { public int getPing() {
return this.getHandle().latency; return this.getHandle().latency;
@@ -1727,6 +1798,159 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1727,6 +1798,160 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getInventory().setItemInMainHand(hand); getInventory().setItemInMainHand(hand);
} }
@ -2443,9 +2443,10 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1
+ final ServerGamePacketListenerImpl connection = player.connection; + final ServerGamePacketListenerImpl connection = player.connection;
+ final net.minecraft.world.entity.player.Inventory inventory = player.getInventory(); + final net.minecraft.world.entity.player.Inventory inventory = player.getInventory();
+ final int slot = inventory.items.size() + inventory.selected; + final int slot = inventory.items.size() + inventory.selected;
+ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, item)); + final int stateId = getHandle().containerMenu.getStateId();
+ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, stateId, slot, item));
+ connection.send(new net.minecraft.network.protocol.game.ClientboundOpenBookPacket(net.minecraft.world.InteractionHand.MAIN_HAND)); + connection.send(new net.minecraft.network.protocol.game.ClientboundOpenBookPacket(net.minecraft.world.InteractionHand.MAIN_HAND));
+ connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, inventory.getSelected())); + connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, stateId, slot, inventory.getSelected()));
+ } + }
+ // Paper end + // Paper end
+ +
@ -2453,7 +2454,7 @@ index 969d5071dbf3356b80da38526351d488ab936c08..9c643472f0c271dcd41721cc121f7af1
private final Player.Spigot spigot = new Player.Spigot() private final Player.Spigot spigot = new Player.Spigot()
{ {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e260366ca4f0ba7f37b7e78e3b46a05d91079d8d..ae12d4a7b56ec70ac5f529e0f336019e97f667ce 100644 index 247c00d35647838264e7acd58019abf1939a594d..bd1e9c1bd9af8bf3fb599cfb0a54a0c948cc2b1b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -787,9 +787,9 @@ public class CraftEventFactory { @@ -787,9 +787,9 @@ public class CraftEventFactory {
@ -2603,10 +2604,10 @@ index 6a64fbb8b4937f39d5fdc2e2cbec26c83c74c486..7d6b5fdb00a5c1614849735634262a36
public String getTitle() { public String getTitle() {
return CraftChatMessage.fromComponent(this.container.getTitle()); return CraftChatMessage.fromComponent(this.container.getTitle());
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 27bbec5f779e7193818e546dbf02a761ff950719..8f05c6832fc968666f0e6e0a19f6dd74d92d0c28 100644 index e3c49a85e24340ecc84225bac8f79492801dc48c..4b038b7f4176dc1a1a47d7694d95ce0e4ec38a2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -337,4 +337,17 @@ public final class CraftItemFactory implements ItemFactory { @@ -340,4 +340,17 @@ public final class CraftItemFactory implements ItemFactory {
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException { public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
return ((CraftMetaItem) meta).updateMaterial(material); return ((CraftMetaItem) meta).updateMaterial(material);
} }
@ -2864,10 +2865,10 @@ index 00445fc7373c70f4cecc4114f9bcfb4b6f27c0e8..0cf60eb9b6ba1a79c9b603c4349debd4
return builder; return builder;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 2d775fe575e61a6503aee1bc9623aebce75143cc..970fa1e98c873ea4dfd4b58c56b7ea88283b0512 100644 index a096c9f7fb459200f8d1f2c797a29bc1222c86af..86163b56d10689aa512953c8df869aa45ebac735 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -745,6 +745,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -746,6 +746,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers()); return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers());
} }
@ -2886,7 +2887,7 @@ index 2d775fe575e61a6503aee1bc9623aebce75143cc..970fa1e98c873ea4dfd4b58c56b7ea88
@Override @Override
public String getDisplayName() { public String getDisplayName() {
return CraftChatMessage.fromJSONComponent(displayName); return CraftChatMessage.fromJSONComponent(displayName);
@@ -780,6 +792,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -781,6 +793,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore != null && !this.lore.isEmpty(); return this.lore != null && !this.lore.isEmpty();
} }
@ -3193,7 +3194,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a
boolean hadFormat = false; boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 0f0ffedd2cc3cf1b30b338d8ae3a8ad388dfde53..409515c406f5b5cfac9872f925dbc67159a5d41f 100644 index 7a3ba7590249d6a3eb37f894c9cfd414a8ccf3fd..fa64a0ea5b6dd9c6031fe54c9030bdb1999ef109 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -19,7 +19,7 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..018792503e5d18470ad17b9f4b4524d5dfba31e9 100644 index e21f83ca4520da2e518950de5f8bc84d666158e6..04f2cee8045ba74993e10230c3ad7ca80fb048d6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@ -31,10 +31,10 @@ index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..018792503e5d18470ad17b9f4b4524d5
return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
} }
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1dde3e92725883c277f9a8e78cb6a56238af3254 100644 index 6b4e78af38fe5b2567597d6267ddecd252585b5a..8e2f3ffae0071be4f44c9b04269913d9daed2a4d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity { @@ -104,6 +104,7 @@ public abstract class Mob extends LivingEntity {
private final BodyRotationControl bodyRotationControl; private final BodyRotationControl bodyRotationControl;
protected PathNavigation navigation; protected PathNavigation navigation;
public GoalSelector goalSelector; public GoalSelector goalSelector;
@ -42,7 +42,7 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1dde3e92725883c277f9a8e78cb6a562
public GoalSelector targetSelector; public GoalSelector targetSelector;
private LivingEntity target; private LivingEntity target;
private final Sensing sensing; private final Sensing sensing;
@@ -794,7 +795,17 @@ public abstract class Mob extends LivingEntity { @@ -795,7 +796,17 @@ public abstract class Mob extends LivingEntity {
@Override @Override
protected final void serverAiStep() { protected final void serverAiStep() {
++this.noActionTime; ++this.noActionTime;

View File

@ -30,10 +30,10 @@ index b41e7922dd96c3358eb849ab39982a75736e3476..2f0d582baf0eb2bb477944d0cb1369db
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index a5d90af5275c9c8069932f711069a6d422303d05..697f73cabfe89e716c9fceeb8362237d27ca3d02 100644 index 8e2f3ffae0071be4f44c9b04269913d9daed2a4d..f8dcd9cb5e6d223f4f5445a4172cc6c4ea160313 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -773,16 +773,16 @@ public abstract class Mob extends LivingEntity { @@ -774,16 +774,16 @@ public abstract class Mob extends LivingEntity {
int i = this.getType().getCategory().getDespawnDistance(); int i = this.getType().getCategory().getDespawnDistance();
int j = i * i; int j = i * i;

View File

@ -20,10 +20,10 @@ index 2f0d582baf0eb2bb477944d0cb1369db6ca33956..89e76dd73811fd0f6f8c8e7e5af804d5
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 59730455fcdf22bada7288833cf7e8b6c9b4096a..d106ab5bbe0647aa2ad285baaabb62b79ced3c06 100644 index e38cd4df0924cce7fee4fd98967990945a62ecf4..a682e7a621b799d0855318788c7f5ad108716256 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -236,6 +236,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -237,6 +237,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}); });
// CraftBukkit end // CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings

View File

@ -19,10 +19,10 @@ index 2c53a400611c78236c5a1c1270d27c02e94251bf..a1d5c0f8fe2adb2ee56f3217e089211e
if (outputStream != null) { if (outputStream != null) {
try { try {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4985aa808fa378ab0463470d4635fda9cc15d268..5b68bc18c39bb34a188782b36da59a5d5280bdd9 100644 index fcc775723bcef7c6b740ee332c21ef70e591c77e..0ee92562ef7c6ac99f5bea0b6d0751d0add50f16 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1418,7 +1418,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1420,7 +1420,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate @DontObfuscate
public String getServerModName() { public String getServerModName() {
@ -30,9 +30,9 @@ index 4985aa808fa378ab0463470d4635fda9cc15d268..5b68bc18c39bb34a188782b36da59a5d
+ return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! + return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
} }
public SystemReport fillSystemReport(SystemReport systemreport) { public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e2564dee0603735d135d1de2af6801a0f2a93e7d..f00844d2953e6ead58bfd383a214695b3dbe5086 100644 index d6cb58d5c5f6d2f4aa769f4338ba63b2d55dc971..171c78b405d35464ce0f66333a3798b6b8a0fb7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -227,7 +227,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -227,7 +227,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;

View File

@ -202,10 +202,10 @@ index 0000000000000000000000000000000000000000..aac3f66cb23d260729c2a48d8710a9de
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 844d3b910cfb1c073b8b58b0eff3f28af5453701..566390d02b2af4a0f2c867b7ff8116a8301e8497 100644 index 2b062beaad39f2e86801fdd5b0cc84b253f1348a..bd94277862e0f5546b4df81fbd535d2e4c7ef5b1 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -202,6 +202,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -203,6 +203,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return false; return false;
} }
com.destroystokyo.paper.PaperConfig.registerCommands(); com.destroystokyo.paper.PaperConfig.registerCommands();

View File

@ -21,10 +21,10 @@ index 195989667c7d844399a72787819f62a3fd0d9c78..d17b75ad13bbc8a38cdc2f2d77ee5d88
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) { public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
double d4 = max * max; double d4 = max * max;
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 26d5b58eb665da53eda30a19300df4c0928c41ef..1039c379b5f39178c568ff9c357a1cf948e0429a 100644 index f8dcd9cb5e6d223f4f5445a4172cc6c4ea160313..78e2d0165f6f6da4d7d1e1dad76e5edcbe48df9e 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -766,7 +766,7 @@ public abstract class Mob extends LivingEntity { @@ -767,7 +767,7 @@ public abstract class Mob extends LivingEntity {
if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { if (this.level.getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
this.discard(); this.discard();
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
@ -47,7 +47,7 @@ index 7d741c2aebbc1c6cf1ff59cca6480325db6ca29c..2459ae800a5f6b234a4f4bb1cd3738e4
return false; return false;
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index bf51e880b0bb81e36c7ef435e057157adfeaede7..4588d0ac68c56942af6ab59f26c68dc65996c6a1 100644 index 05c292d08ac98fad408b279d2426ff08472a959c..484b1bf43b897c5ffe47baa340957e3293c7bf92 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -176,6 +176,9 @@ public abstract class Player extends LivingEntity { @@ -176,6 +176,9 @@ public abstract class Player extends LivingEntity {
@ -117,7 +117,7 @@ index 389985e022b82c675fb21f363422471bd15b84b0..849616d9ad140285f7aa4d2ffafd6371
for(Player player : this.players()) { for(Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index bc901793055db9481ec32e668386ba33696bc0a5..f14488b00add3b8209554e670ca2ea2f49e04a95 100644 index 9c643472f0c271dcd41721cc121f7af161cafd9b..f253483eab0610b9c88174d7ae78b24ef5730242 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1778,8 +1778,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1778,8 +1778,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95cf1122a2 100644 index 0ee92562ef7c6ac99f5bea0b6d0751d0add50f16..6225e9391ddff28d8f71a9f643ef2c41f69e6fe7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -285,7 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -281,7 +281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
public ConsoleReader reader; public ConsoleReader reader;
@ -24,7 +24,7 @@ index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
public Commands vanillaCommandDispatcher; public Commands vanillaCommandDispatcher;
@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -290,7 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start // Spigot start
public static final int TPS = 20; public static final int TPS = 20;
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS; public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
@ -33,7 +33,7 @@ index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end // Spigot end
@@ -982,6 +982,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -990,6 +990,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{ {
return ( avg * exp ) + ( tps * ( 1 - exp ) ); return ( avg * exp ) + ( tps * ( 1 - exp ) );
} }
@ -91,7 +91,7 @@ index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95
// Spigot End // Spigot End
protected void runServer() { protected void runServer() {
@@ -994,25 +1045,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1002,25 +1053,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start // Spigot start
Arrays.fill( recentTps, 20 ); Arrays.fill( recentTps, 20 );
@ -132,7 +132,7 @@ index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95
tickSection = curTime; tickSection = curTime;
} }
// Spigot end // Spigot end
@@ -1022,7 +1080,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1030,7 +1088,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
} }
@ -143,7 +143,7 @@ index 26f6a3d2d70078f300412a5076afb8a19818cd25..65b2fa69fd36addc9534f069cce8ec95
this.startMetricsRecordingTick(); this.startMetricsRecordingTick();
this.profiler.push("tick"); this.profiler.push("tick");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9a223acb40ffedad51037b25b9f8b01c6691ed14..a4f0bb3553fb46efa17b00805c8881b59a25db6c 100644 index 171c78b405d35464ce0f66333a3798b6b8a0fb7b..6210e0ef9e44459c523c70bcb8dfb05f97b868fc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2131,6 +2131,17 @@ public final class CraftServer implements Server { @@ -2131,6 +2131,17 @@ public final class CraftServer implements Server {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index d29334b5dee6fe3f292f774442304b7dc6b0e2f0..939f88ab37eca30e8ad08cbe2045b66ee64aa952 100644 index a682e7a621b799d0855318788c7f5ad108716256..cb8512221e17e1a5066aa6610564c2f24ef02da8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -729,11 +729,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -734,11 +734,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);
} catch (Throwable throwable) { } catch (Throwable throwable) {

View File

@ -20,10 +20,10 @@ index 4bba6977a0287837b8927718c040ac61463f0469..e6e18f309dc09ea9416ea37dcc697ddc
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ae04883b57d44fdfb748f1aad0b7a2e24120ebeb..b25f9a2d2d7f0af0fef60c4f1817cf165fed9cd6 100644 index a8a0f65d99ed062467e50a79349dc6b56f325709..094228ff071218f49d07f8e5343e1544c98e14d1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -938,6 +938,7 @@ public class ServerPlayer extends Player { @@ -934,6 +934,7 @@ public class ServerPlayer extends Player {
this.unRide(); this.unRide();
this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) { if (!this.wonGame) {

View File

@ -25,10 +25,10 @@ index e6e18f309dc09ea9416ea37dcc697ddc2b571a96..4881b03d470646843bad1bc343eb6a6a
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ca439ac2a09a2ce4e019282c0b75f2f5d41a2208..3b4e679cc3c711635e6e2f3906a0afd2142c7849 100644 index 6225e9391ddff28d8f71a9f643ef2c41f69e6fe7..d1267242746fe2aee0fd12ed01900e4e72df3f89 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1397,6 +1397,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1399,6 +1399,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
this.profiler.pop(); this.profiler.pop();
@ -135,10 +135,10 @@ index a723b60bdb4b90b30b0b26c9488ede2b1177208f..5e06fa58bd5064fea4154f7f34fdef6a
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index c427c105c653a0b0de6ad33d1d6f622a31a5a680..794d43e6f1a2019f67daf7a93498225924c4394b 100644 index cb8512221e17e1a5066aa6610564c2f24ef02da8..cd40ec40a09c87e3a2e35b121970d1518f43a8f8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -153,6 +153,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -154,6 +154,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition; private int tileTickPosition;

View File

@ -7,10 +7,10 @@ I hope to look at this more in-depth soon. It appears doable.
However this should not block the update. However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index f4b850fd8504cd3c84786f990dec43f17a2c422e..a44aa391e77d7be7eac00643558884d01c320aab 100644 index 094228ff071218f49d07f8e5343e1544c98e14d1..505cf31d1cc89d463c1b61fdf9b2247ce2743dc8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -170,6 +170,8 @@ import org.bukkit.inventory.MainHand; @@ -171,6 +171,8 @@ import org.bukkit.inventory.MainHand;
public class ServerPlayer extends Player { public class ServerPlayer extends Player {
@ -20,7 +20,7 @@ index f4b850fd8504cd3c84786f990dec43f17a2c422e..a44aa391e77d7be7eac00643558884d0
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 13f2e3f6a7f4ffc3394264889b41d6791730d1e7..755dda2de8de4719251be884dcc1ae953df1856c 100644 index 3adbe2aa72ffc6441018026e14de54e640487b4f..9dc1339a3975cc3c08e408181dda29878c8f52e2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -371,6 +371,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -371,6 +371,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -19,10 +19,10 @@ index 4de86b09c6bc3c1974ce61b550ccb73d37f6f170..5a4c3a8c511f22c8c3240c9c7cd83a65
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 74b38b853bd7a59f4cf42afed5ee7ca86b34a8c7..f222721c7bfa555a45c34b489a9e7af59a1f183c 100644 index 505cf31d1cc89d463c1b61fdf9b2247ce2743dc8..3f676bab4448de3658a4c631916740be7be6a193 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -216,6 +216,7 @@ public class ServerPlayer extends Player { @@ -217,6 +217,7 @@ public class ServerPlayer extends Player {
private int containerCounter; private int containerCounter;
public int latency; public int latency;
public boolean wonGame; public boolean wonGame;
@ -30,7 +30,7 @@ index 74b38b853bd7a59f4cf42afed5ee7ca86b34a8c7..f222721c7bfa555a45c34b489a9e7af5
// CraftBukkit start // CraftBukkit start
public String displayName; public String displayName;
@@ -591,7 +592,12 @@ public class ServerPlayer extends Player { @@ -587,7 +588,12 @@ public class ServerPlayer extends Player {
--this.invulnerableTime; --this.invulnerableTime;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index f599b1e7eb6fddb339294265fe635fa7b3bb5996..da8e6f5b48a83ca4178c0de439200b7952f409d9 100644 index cd40ec40a09c87e3a2e35b121970d1518f43a8f8..bc0adb68931c9c1404bf87a3f7643b4982e4ae35 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -695,9 +695,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -700,9 +700,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start // Spigot start
// Iterator iterator = this.blockEntityTickers.iterator(); // Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0; int tilesThisCycle = 0;

View File

@ -9,10 +9,10 @@ This is a duplicate API from spigot, so use our duplicate subclass and
improve setPosition to use raw improve setPosition to use raw
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 186c745401a3320432f4aadfadfc6ef4b1d8041c..cf1621fad7f9b3ec03f1c3722856186273c7935e 100644 index 14cf49b910bd789f1dd61d303b88d53a93c3abd6..0ea5574ab43141a69e6aa5e05aeb548660f126e1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -214,7 +214,7 @@ public abstract class PlayerList { @@ -216,7 +216,7 @@ public abstract class PlayerList {
// Spigot start - spawn location event // Spigot start - spawn location event
Player spawnPlayer = player.getBukkitEntity(); Player spawnPlayer = player.getBukkitEntity();
@ -21,7 +21,7 @@ index 186c745401a3320432f4aadfadfc6ef4b1d8041c..cf1621fad7f9b3ec03f1c37228561862
this.cserver.getPluginManager().callEvent(ev); this.cserver.getPluginManager().callEvent(ev);
Location loc = ev.getSpawnLocation(); Location loc = ev.getSpawnLocation();
@@ -222,7 +222,10 @@ public abstract class PlayerList { @@ -224,7 +224,10 @@ public abstract class PlayerList {
player.setLevel(worldserver1); player.setLevel(worldserver1);
player.gameMode.setLevel((ServerLevel) player.level); player.gameMode.setLevel((ServerLevel) player.level);

View File

@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async. that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4fc871595a2449cb22bceb8ed279fe91166597f9..2bb324f8186c70319446af3f639191c8e99f9de5 100644 index da9f4b3337b49597c17b50964656457cd629a0b7..22c2c121bbcc7b0e15d73d20c9cc83d5fb085e5f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1859,6 +1859,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1846,6 +1846,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} }
if (!async && s.startsWith("/")) { if (!async && s.startsWith("/")) {
@ -48,7 +48,7 @@ index 4fc871595a2449cb22bceb8ed279fe91166597f9..2bb324f8186c70319446af3f639191c8
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c00f2263b8cee28d32e73c1eddaeb02be9e8b68c..d645c9d3d9b3af58e9fafb03cbf74c2ee49d1fd4 100644 index 6210e0ef9e44459c523c70bcb8dfb05f97b868fc..06e32113c6274f3e409f10e46a1162cc56afce88 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -758,6 +758,28 @@ public final class CraftServer implements Server { @@ -758,6 +758,28 @@ public final class CraftServer implements Server {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index cbc968d0d514f01b26888f3ff8264d8689d9381a..e38e53bd39c384bac4d7111e6a2c721744a122f1 100644 index 22bc8fa039375a3205bdfdf05b6c73c856fb1b16..b10cf0c5800397520f57c0bbc88a52e52db6a4c8 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -332,6 +332,11 @@ public class FriendlyByteBuf extends ByteBuf { @@ -357,6 +357,11 @@ public class FriendlyByteBuf extends ByteBuf {
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
} }
@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4d73fa595ffdf04646f53f0e8ef7795d632ca4f2..8b2f018875d64de96abe99b587f113b256889a0e 100644 index 9dc1339a3975cc3c08e408181dda29878c8f52e2..cd9998a6bd9f76cdda124ab4a0bc671ec1f00777 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure inv drag is in bounds
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index eaf2c55328e5dd6b7b55b5701501e4441923f060..0d832c4f0c62f56b9208720afcdcc02044662c90 100644 index 13e5dbc79dc8b70d158717ad48f64240a2643714..60a67f75b4f772654e064e2b19f68a907ca4c93b 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -374,7 +374,7 @@ public abstract class AbstractContainerMenu { @@ -406,7 +406,7 @@ public abstract class AbstractContainerMenu {
this.resetQuickCraft(); this.resetQuickCraft();
} }
} else if (this.quickcraftStatus == 1) { } else if (this.quickcraftStatus == 1) {

View File

@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3b1565309165e10b147d08b8245ea0bce50dc3c2..4ebb839076a2d1f5e2acc6d5a8dfcf3545b37721 100644 index 4788946d7fb25c1b0f26e6a038924c4a62978d53..82b25044e1852f5dbde1a658fe5f4f7526fa2b34 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -825,6 +825,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -826,6 +826,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return true; return true;
} catch (Exception exception) { } catch (Exception exception) {
ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception); ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
@ -61,7 +61,7 @@ index 3b1565309165e10b147d08b8245ea0bce50dc3c2..4ebb839076a2d1f5e2acc6d5a8dfcf35
} }
} }
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index 741bc569617c66f90ded58a28dd3ad0e4e8b1e8c..8e27b43e2f6ce4d7f5007fe02db1722e73c30a58 100644 index ddeb3c4c46f22ca651588fed02b4941c31c5be9d..aafd67d5b4f2a0555bc2fa0444d22f545ad71bf4 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -71,7 +71,7 @@ index 741bc569617c66f90ded58a28dd3ad0e4e8b1e8c..8e27b43e2f6ce4d7f5007fe02db1722e
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.io.Files; import com.google.common.io.Files;
@@ -362,6 +363,7 @@ public class OldUsersConverter { @@ -363,6 +364,7 @@ public class OldUsersConverter {
root = NbtIo.readCompressed(new java.io.FileInputStream(file5)); root = NbtIo.readCompressed(new java.io.FileInputStream(file5));
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
@ -79,7 +79,7 @@ index 741bc569617c66f90ded58a28dd3ad0e4e8b1e8c..8e27b43e2f6ce4d7f5007fe02db1722e
} }
if (root != null) { if (root != null) {
@@ -375,6 +377,7 @@ public class OldUsersConverter { @@ -376,6 +378,7 @@ public class OldUsersConverter {
NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2)); NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2));
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
@ -108,7 +108,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 718f31b74207c7ef06c1861fbc58de01cf67be3b..dda9ac55bd7b8cce055eac1f067d7ab70ed4dca7 100644 index bc0adb68931c9c1404bf87a3f7643b4982e4ae35..33b20b43961051d2c116871ad63baa908fa71cd5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
@ -122,7 +122,7 @@ index 718f31b74207c7ef06c1861fbc58de01cf67be3b..dda9ac55bd7b8cce055eac1f067d7ab7
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import java.io.IOException; import java.io.IOException;
@@ -731,6 +736,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -736,6 +741,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes // Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable); MinecraftServer.LOGGER.error(msg, throwable);
@ -131,7 +131,7 @@ index 718f31b74207c7ef06c1861fbc58de01cf67be3b..dda9ac55bd7b8cce055eac1f067d7ab7
// Paper end // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index b4a7776ba9486bbca42ffb596c8a8bcdf6471ce3..59fae60116167baf989e85596334824e9004e6fb 100644 index 808fd30d4b86ca9029c182ffdceaf27f3c204377..4ea02bfe348cec26bbb2c15ddacbbc110033b2d3 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -308,6 +308,7 @@ public final class NaturalSpawner { @@ -308,6 +308,7 @@ public final class NaturalSpawner {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b5f72467b924d2bb7871b5af547ee794b8080803..cbd7e9b6b3d0cd5cb87ed8b2657daee9368424a0 100644 index 22c2c121bbcc7b0e15d73d20c9cc83d5fb085e5f..edb66e8c4507597ec8c35883460f88de8b263e54 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1641,8 +1641,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1628,8 +1628,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect")); this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"));
} }
@ -23,7 +23,7 @@ index b5f72467b924d2bb7871b5af547ee794b8080803..cbd7e9b6b3d0cd5cb87ed8b2657daee9
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 161fcf68dc85fc6d7b0034f137b1a5aee26cbb69..03b2fd38b31de911ef107006a3d10c5534989247 100644 index 04e87f895dc3822cd1fe486c6ff0f6cd4415024b..45a8dc649983f1eec3d8eb065cb34d517c55300b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -142,6 +142,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -142,6 +142,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's. ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 1b3cf8e6310c83f9303705339bfa131c90b0ac3d..bbaf615a150bc9c1ad61d509209350eec922a9f2 100644 index 4a1ca04332e5afe0379276f3cefab7e0bf03a07b..c97021729460eb5710b38e9dbe6b8da70261da74 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols; @@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols;
@ -30,7 +30,7 @@ index 1b3cf8e6310c83f9303705339bfa131c90b0ac3d..bbaf615a150bc9c1ad61d509209350ee
import java.util.Locale; import java.util.Locale;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects; import java.util.Objects;
@@ -153,6 +155,23 @@ public final class ItemStack { @@ -151,6 +153,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this); return this.getItem().getTooltipImage(this);
} }
@ -54,7 +54,7 @@ index 1b3cf8e6310c83f9303705339bfa131c90b0ac3d..bbaf615a150bc9c1ad61d509209350ee
public ItemStack(ItemLike item) { public ItemStack(ItemLike item) {
this(item, 1); this(item, 1);
} }
@@ -196,6 +215,7 @@ public final class ItemStack { @@ -194,6 +213,7 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread // CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy(); this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy();
// CraftBukkit end // CraftBukkit end
@ -70,16 +70,16 @@ index 1b3cf8e6310c83f9303705339bfa131c90b0ac3d..bbaf615a150bc9c1ad61d509209350ee
if (this.getItem().canBeDepleted()) { if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue()); this.setDamageValue(this.getDamageValue());
} }
@@ -1055,6 +1076,7 @@ public final class ItemStack { @@ -1052,6 +1073,7 @@ public final class ItemStack {
nbttagcompound.putString("id", String.valueOf(Registry.ENCHANTMENT.getKey(enchantment))); ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttagcompound.putShort("lvl", (short) ((byte) level));
nbttaglist.add(nbttagcompound); nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));
+ processEnchantOrder(nbttagcompound); // Paper + processEnchantOrder(this.tag); // Paper
} }
public boolean isEnchanted() { public boolean isEnchanted() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index d11f50cab14cf1483c88914912ae018ce016ac50..799af645a0a39877dc36417110a73fe33d743ba4 100644 index b89292f10e254616bfe3da4700eb12a9fd41f25d..379612cb78d275fa61125390c7429fcb2920ab33 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -6,7 +6,6 @@ import java.util.Map; @@ -6,7 +6,6 @@ import java.util.Map;
@ -202,7 +202,7 @@ index d11f50cab14cf1483c88914912ae018ce016ac50..799af645a0a39877dc36417110a73fe3
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) { static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4bd0536d39 100644 index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571baab297799 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -229,7 +229,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@@ -271,7 +274,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -272,7 +275,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private List<String> lore; // null and empty are two different states internally private List<String> lore; // null and empty are two different states internally
private Integer customModelData; private Integer customModelData;
private CompoundTag blockData; private CompoundTag blockData;
@ -238,7 +238,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
private Multimap<Attribute, AttributeModifier> attributeModifiers; private Multimap<Attribute, AttributeModifier> attributeModifiers;
private int repairCost; private int repairCost;
private int hideFlag; private int hideFlag;
@@ -282,7 +285,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -283,7 +286,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
private CompoundTag internalTag; private CompoundTag internalTag;
@ -247,7 +247,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY);
private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only
@@ -303,7 +306,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -304,7 +307,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.blockData = meta.blockData; this.blockData = meta.blockData;
if (meta.enchantments != null) { // Spigot if (meta.enchantments != null) { // Spigot
@ -256,7 +256,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
} }
if (meta.hasAttributeModifiers()) { if (meta.hasAttributeModifiers()) {
@@ -386,13 +389,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -387,13 +390,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -272,7 +272,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
for (int i = 0; i < ench.size(); i++) { for (int i = 0; i < ench.size(); i++) {
String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT); String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT);
@@ -545,13 +548,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -546,13 +549,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -288,7 +288,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
for (Map.Entry<?, ?> entry : ench.entrySet()) { for (Map.Entry<?, ?> entry : ench.entrySet()) {
// Doctor older enchants // Doctor older enchants
String enchantKey = entry.getKey().toString(); String enchantKey = entry.getKey().toString();
@@ -827,14 +830,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -828,14 +831,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public Map<Enchantment, Integer> getEnchants() { public Map<Enchantment, Integer> getEnchants() {
@ -305,7 +305,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
} }
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -1215,7 +1218,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1216,7 +1219,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData; clone.customModelData = this.customModelData;
clone.blockData = this.blockData; clone.blockData = this.blockData;
if (this.enchantments != null) { if (this.enchantments != null) {
@ -314,7 +314,7 @@ index 970fa1e98c873ea4dfd4b58c56b7ea88283b0512..45f4f8265c51a5b08db8aa7f53915c4b
} }
if (this.hasAttributeModifiers()) { if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1448,4 +1451,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1450,4 +1453,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftMetaItem.HANDLED_TAGS; return CraftMetaItem.HANDLED_TAGS;
} }
} }

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic. Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9b98eddb8238e36b17989d6f685ddc950151a7f8..b8a816a2f58c1ab51271f027f500d08bc3a63503 100644 index addd1e75b796b01d15d8c087329bfc4fb9823fbe..62bf85a8590c3dc00c74671303b4e7ce790fdc0b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -202,7 +202,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -202,7 +202,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@ -19,10 +19,10 @@ index 9b98eddb8238e36b17989d6f685ddc950151a7f8..b8a816a2f58c1ab51271f027f500d08b
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 76182fd83d6dcd2359dd8d8a75e7e15304dc5d0f..9f69dfcb5d9cbbcd01dd2e5e02437967da7a4a17 100644 index 33b20b43961051d2c116871ad63baa908fa71cd5..8eff4c4b82cd2d0d58af00c6c88f156315d53600 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -309,11 +309,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -310,11 +310,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
@Override @Override

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668d3771a79 100644 index 6c2adddb3d55e5384d1386788bce13ee4c7a6bbe..a492f0b8393c185f0464f0fb0e5d5dce4d0e3824 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3560,9 +3560,10 @@ public abstract class LivingEntity extends Entity { @@ -3563,9 +3563,10 @@ public abstract class LivingEntity extends Entity {
this.triggerItemUseEffects(this.useItem, 16); this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent // CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack; ItemStack itemstack;
@ -20,7 +20,7 @@ index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668
level.getCraftServer().getPluginManager().callEvent(event); level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@@ -3576,6 +3577,13 @@ public abstract class LivingEntity extends Entity { @@ -3579,6 +3580,13 @@ public abstract class LivingEntity extends Entity {
} else { } else {
itemstack = this.useItem.finishUsingItem(this.level, this); itemstack = this.useItem.finishUsingItem(this.level, this);
} }
@ -34,7 +34,7 @@ index 46e514bfe80d999f50173866b59fbc9419bbf3d0..89db2afd198366ab94c9c074890aa668
// CraftBukkit end // CraftBukkit end
if (itemstack != this.useItem) { if (itemstack != this.useItem) {
@@ -3583,6 +3591,11 @@ public abstract class LivingEntity extends Entity { @@ -3586,6 +3594,11 @@ public abstract class LivingEntity extends Entity {
} }
this.stopUsingItem(); this.stopUsingItem();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c811e81e53c 100644 index a492f0b8393c185f0464f0fb0e5d5dce4d0e3824..a0d6cc4eeda0a7a09724b6482da71c969abcfeb0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -764,7 +764,13 @@ public abstract class LivingEntity extends Entity { @@ -764,7 +764,13 @@ public abstract class LivingEntity extends Entity {
@ -34,7 +34,7 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81
// CraftBukkit start - Handle scaled health // CraftBukkit start - Handle scaled health
if (this instanceof ServerPlayer) { if (this instanceof ServerPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity(); org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
@@ -3395,7 +3405,7 @@ public abstract class LivingEntity extends Entity { @@ -3398,7 +3408,7 @@ public abstract class LivingEntity extends Entity {
} }
public void setAbsorptionAmount(float amount) { public void setAbsorptionAmount(float amount) {
@ -43,13 +43,13 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81
amount = 0.0F; amount = 0.0F;
} }
@@ -4000,3 +4010,4 @@ public abstract class LivingEntity extends Entity { @@ -4003,3 +4013,4 @@ public abstract class LivingEntity extends Entity {
this.setDeltaMovement((double) ((float) packet.getXd() / 8000.0F), (double) ((float) packet.getYd() / 8000.0F), (double) ((float) packet.getZd() / 8000.0F)); this.setDeltaMovement((double) ((float) packet.getXd() / 8000.0F), (double) ((float) packet.getYd() / 8000.0F), (double) ((float) packet.getZd() / 8000.0F));
} }
} }
+ +
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 03b2fd38b31de911ef107006a3d10c5534989247..2dab55e7d807ae8414fbb1f4446df2f38783cfb4 100644 index 45a8dc649983f1eec3d8eb065cb34d517c55300b..50267f9877898d7108edc057140e3e572eac9461 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1702,6 +1702,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1702,6 +1702,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -33,10 +33,10 @@ index 964bec1d3fecfe43a43bd9968159fca069f00dfd..e188f130e47ef319477050981de53a74
this.x = x; this.x = x;
this.y = y; this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8592de5a5541fbff8ec85bfce8635a780097c4d4..bbe2d5eab844880f2fde674aa1c78d60d6152231 100644 index 8eff4c4b82cd2d0d58af00c6c88f156315d53600..c6dbace64d19de52112c64c824640cf48db216e3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -259,7 +259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -260,7 +260,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
public boolean isInWorldBounds(BlockPos pos) { public boolean isInWorldBounds(BlockPos pos) {
@ -90,7 +90,7 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1
@Override @Override
public FluidState getFluidState(BlockPos pos) { public FluidState getFluidState(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 249f39bc0c5820e313cad7813bd1087cb2e09ed6..b737ffb8af88e7978c3bfc0b2e61639aca3376c0 100644 index bf5a039553a31ed6e9d9bfa64cbd435b3e551a08..db564e9a866c30d6d7b34fa97185b01e8c788449 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess { @@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6826d1e4b7f1595f17a118e8f146bb19f3ef9256..e250db8035b2d53e724a47da6dc6118d85ca148b 100644 index d1267242746fe2aee0fd12ed01900e4e72df3f89..4ed4744c887ca52fa3f85ad4ea41e79543cc13ce 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1363,6 +1363,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1365,6 +1365,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@ -18,7 +18,7 @@ index 6826d1e4b7f1595f17a118e8f146bb19f3ef9256..e250db8035b2d53e724a47da6dc6118d
this.profiler.push(() -> { this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location(); return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0d6a67fdd83de0c62f6e2a90d0107cbebbac3a37..a846f7136d29bd1d8f8ed30d79fa8936fe386618 100644 index 9551e819a9a1ae1f4dc52e1a347d8ee5924d092b..aa9278ff7514fd93a8d0d5f925456a66c4ce8736 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -201,6 +201,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -201,6 +201,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@ -30,10 +30,10 @@ index 0d6a67fdd83de0c62f6e2a90d0107cbebbac3a37..a846f7136d29bd1d8f8ed30d79fa8936
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false); return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bbe2d5eab844880f2fde674aa1c78d60d6152231..285389edd01b1b36dfa8363e7ceea3903229a618 100644 index c6dbace64d19de52112c64c824640cf48db216e3..5c395ffa57372dee3fc29e9bd4b5545211aec29c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -470,7 +470,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -471,7 +471,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start // CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld(); CraftWorld world = ((ServerLevel) this).getWorld();
@ -42,7 +42,7 @@ index bbe2d5eab844880f2fde674aa1c78d60d6152231..285389edd01b1b36dfa8363e7ceea390
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getCraftServer().getPluginManager().callEvent(event); this.getCraftServer().getPluginManager().callEvent(event);
@@ -579,7 +579,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -584,7 +584,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
// CraftBukkit start // CraftBukkit start
CraftWorld world = ((ServerLevel) this).getWorld(); CraftWorld world = ((ServerLevel) this).getWorld();
@ -73,7 +73,7 @@ index 24227939493f852a88477c84160bda1605291eb0..1f8cf302d2309aec2955832ffafd87f1
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
index 08870ea2431ba27474a275006071801c01cc9b1c..9c010d8359a36f3b2d4af3d828bc2dca792ef2f4 100644 index 9edf1b87e59d589b053e5b4fee15faa221718c2f..65a163d93a293e1e0a12a300d6335a700099cac2 100644
--- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java --- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
@@ -4,6 +4,7 @@ import javax.annotation.Nullable; @@ -4,6 +4,7 @@ import javax.annotation.Nullable;
@ -84,7 +84,7 @@ index 08870ea2431ba27474a275006071801c01cc9b1c..9c010d8359a36f3b2d4af3d828bc2dca
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@@ -85,7 +86,7 @@ public class DoublePlantBlock extends BushBlock { @@ -93,7 +94,7 @@ public class DoublePlantBlock extends BushBlock {
protected static void preventCreativeDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) { protected static void preventCreativeDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
// CraftBukkit start // CraftBukkit start

View File

@ -20,10 +20,10 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510
static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() { static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() {
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cbd7e9b6b3d0cd5cb87ed8b2657daee9368424a0..8e751e9821dc76f33e9e844990c701f69c817c4b 100644 index edb66e8c4507597ec8c35883460f88de8b263e54..60772b6d6fe171d7dd832cb132f7c56db9439bdb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2203,8 +2203,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2190,8 +2190,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}); });
} }
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix reducedDebugInfo not initialized on client
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index cf1621fad7f9b3ec03f1c3722856186273c7935e..dd0cde1ef149ae708fa7b0c043acfcc489fe497c 100644 index 0ea5574ab43141a69e6aa5e05aeb548660f126e1..b2638a7dbe2ead274e9e2e337babe41c90179f8b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -247,6 +247,7 @@ public abstract class PlayerList { @@ -249,6 +249,7 @@ public abstract class PlayerList {
playerconnection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected)); playerconnection.send(new ClientboundSetCarriedItemPacket(player.getInventory().selected));
playerconnection.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes())); playerconnection.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes()));
playerconnection.send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork((RegistryAccess) this.registryHolder))); playerconnection.send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork((RegistryAccess) this.registryHolder)));

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 285389edd01b1b36dfa8363e7ceea3903229a618..ce86590b4060d9705831303ab23f0294129760b9 100644 index 5c395ffa57372dee3fc29e9bd4b5545211aec29c..22c4c94a4b81c8ca53d717005b6260f0bafbbea4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -537,6 +537,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -542,6 +542,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {} public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
public void updateNeighborsAt(BlockPos pos, Block block) { public void updateNeighborsAt(BlockPos pos, Block block) {

View File

@ -32,10 +32,10 @@ index 8885220e4813b34627b42523834bbec995d8950d..4c9660176e783999301565790b8cf6f4
buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix); buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e250db8035b2d53e724a47da6dc6118d85ca148b..6bed68a09e427f0846f322b5a30a44ed09654fa6 100644 index 4ed4744c887ca52fa3f85ad4ea41e79543cc13ce..275e7503ec6a0ceec9839c7d11fb3710cf9f15d2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -163,6 +163,7 @@ import net.minecraft.world.level.storage.loot.LootTables; @@ -160,6 +160,7 @@ import net.minecraft.world.level.storage.loot.LootTables;
import net.minecraft.world.level.storage.loot.PredicateManager; import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
@ -43,7 +43,7 @@ index e250db8035b2d53e724a47da6dc6118d85ca148b..6bed68a09e427f0846f322b5a30a44ed
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@@ -603,6 +604,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -599,6 +600,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
} }
@ -65,10 +65,10 @@ index e250db8035b2d53e724a47da6dc6118d85ca148b..6bed68a09e427f0846f322b5a30a44ed
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections(); this.connection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567967b4b61 100644 index b2638a7dbe2ead274e9e2e337babe41c90179f8b..a9ab9bba799a95351cdb829b84163a564b41e0a8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -85,6 +85,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage; @@ -87,6 +87,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.Objective; import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
@ -76,7 +76,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567
import net.minecraft.world.scores.Team; import net.minecraft.world.scores.Team;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@@ -147,6 +148,7 @@ public abstract class PlayerList { @@ -149,6 +150,7 @@ public abstract class PlayerList {
// CraftBukkit start // CraftBukkit start
private CraftServer cserver; private CraftServer cserver;
private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>(); private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>();
@ -84,7 +84,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567
public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) { public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this); this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
@@ -383,6 +385,13 @@ public abstract class PlayerList { @@ -385,6 +387,13 @@ public abstract class PlayerList {
player.initInventoryMenu(); player.initInventoryMenu();
// CraftBukkit - Moved from above, added world // CraftBukkit - Moved from above, added world
@ -98,7 +98,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
} }
@@ -502,6 +511,16 @@ public abstract class PlayerList { @@ -504,6 +513,16 @@ public abstract class PlayerList {
entityplayer.doTick(); // SPIGOT-924 entityplayer.doTick(); // SPIGOT-924
// CraftBukkit end // CraftBukkit end
@ -115,7 +115,7 @@ index dd0cde1ef149ae708fa7b0c043acfcc489fe497c..9af086f022ed41081a77d9cf82b04567
this.save(entityplayer); this.save(entityplayer);
if (entityplayer.isPassenger()) { if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle(); Entity entity = entityplayer.getRootVehicle();
@@ -1124,6 +1143,13 @@ public abstract class PlayerList { @@ -1126,6 +1145,13 @@ public abstract class PlayerList {
} }
// CraftBukkit end // CraftBukkit end

View File

@ -6,12 +6,12 @@ Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface. For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 3dc2187035fff8c0c338b35c07ca2164ed753b04..e3409d5f4ddcaa4edecfa4b3c638a12624b09f1b 100644 index 9793b51080d0f4adba0d6bc684a6927382420a0b..12e55aabf0daf341ec74688e79c43451e820e6dc 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -67,6 +67,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -67,6 +67,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@Nullable @Nullable
public WorldGenSettings worldGenSettings; private WorldGenSettings worldGenSettings;
+ public final String rconIp; // Paper - Add rcon ip + public final String rconIp; // Paper - Add rcon ip
+ +

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0cb26991acf1d8af3da90a739c722596c4394a9d..71e8b6ecc13eccc9981d06a87a52bd0215e5bbec 100644 index 3f676bab4448de3658a4c631916740be7be6a193..a21496bc07c4691b99f9f58a0493e6e054c02641 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1707,7 +1707,7 @@ public class ServerPlayer extends Player { @@ -1703,7 +1703,7 @@ public class ServerPlayer extends Player {
return s; return s;
} }
@ -17,7 +17,7 @@ index 0cb26991acf1d8af3da90a739c722596c4394a9d..71e8b6ecc13eccc9981d06a87a52bd02
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
public void updateOptions(ServerboundClientInformationPacket packet) { public void updateOptions(ServerboundClientInformationPacket packet) {
// CraftBukkit start // CraftBukkit start
@@ -1715,9 +1715,10 @@ public class ServerPlayer extends Player { @@ -1711,9 +1711,10 @@ public class ServerPlayer extends Player {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event); this.server.server.getPluginManager().callEvent(event);
} }
@ -30,7 +30,7 @@ index 0cb26991acf1d8af3da90a739c722596c4394a9d..71e8b6ecc13eccc9981d06a87a52bd02
this.locale = packet.language; this.locale = packet.language;
// Paper start // Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4cbd2fcbbc96d64116665b13f49f0bb3d4b2bca6..3001399cbbe68621a5605436b74e4e96491b5dad 100644 index 843d7d89253c61d6171368bcfd9ff2263e8c2aaa..b66c96bdfd480c6e913aac32b62ddb0ddba0d93e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1899,8 +1899,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1899,8 +1899,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 15e26dbc38e23c5284246ef55d038eb011759ee2..45bcdf2e644999910784432d8f369e775ce6506d 100644 index 275e7503ec6a0ceec9839c7d11fb3710cf9f15d2..4d5f3509d7be914658014d07c72ec12762a76da3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -189,6 +189,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot @@ -186,6 +186,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements SnooperPopulator, CommandSource, AutoCloseable {
@ -17,7 +17,7 @@ index 15e26dbc38e23c5284246ef55d038eb011759ee2..45bcdf2e644999910784432d8f369e77
public static final Logger LOGGER = LogManager.getLogger(); public static final Logger LOGGER = LogManager.getLogger();
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
private static final int TICK_STATS_SPAN = 100; private static final int TICK_STATS_SPAN = 100;
@@ -318,6 +319,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -314,6 +315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, DataPackConfig datapackconfiguration, Thread thread, RegistryAccess.RegistryHolder iregistrycustom_dimension, LevelStorageSource.LevelStorageAccess convertable_conversionsession, WorldData savedata, PackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, ServerResources datapackresources, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable GameProfileCache usercache, ChunkProgressListenerFactory worldloadlistenerfactory) { public MinecraftServer(OptionSet options, DataPackConfig datapackconfiguration, Thread thread, RegistryAccess.RegistryHolder iregistrycustom_dimension, LevelStorageSource.LevelStorageAccess convertable_conversionsession, WorldData savedata, PackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, ServerResources datapackresources, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable GameProfileCache usercache, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server"); super("Server");
@ -25,7 +25,7 @@ index 15e26dbc38e23c5284246ef55d038eb011759ee2..45bcdf2e644999910784432d8f369e77
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler(); this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> { this.onMetricsRecordingStopped = (methodprofilerresults) -> {
@@ -2233,7 +2235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2235,7 +2237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Deprecated @Deprecated
public static MinecraftServer getServer() { public static MinecraftServer getServer() {

View File

@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed. Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3129332c9e520c5f774b846e81f52103cbf97b8e..8a43b7ebf0195198f11b26a18d6f57bf97885889 100644 index 5ed7028c50ca5dcb2cabada3d8a15874181f6ce8..ee124aa7d18abd266836c79b9acf12c838676135 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1924,6 +1924,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -1924,6 +1924,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@ -25,7 +25,7 @@ index 3129332c9e520c5f774b846e81f52103cbf97b8e..8a43b7ebf0195198f11b26a18d6f57bf
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 4588d0ac68c56942af6ab59f26c68dc65996c6a1..33a61c0ab7e6ed03030bdd8d8635d989b28bd169 100644 index 484b1bf43b897c5ffe47baa340957e3293c7bf92..c825ad2d04b964561355cb0564f9f5507848217f 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -88,6 +88,7 @@ import net.minecraft.world.item.ElytraItem; @@ -88,6 +88,7 @@ import net.minecraft.world.item.ElytraItem;
@ -44,7 +44,7 @@ index 4588d0ac68c56942af6ab59f26c68dc65996c6a1..33a61c0ab7e6ed03030bdd8d8635d989
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
@@ -736,6 +738,12 @@ public abstract class Player extends LivingEntity { @@ -732,6 +734,12 @@ public abstract class Player extends LivingEntity {
return null; return null;
} }
// CraftBukkit end // CraftBukkit end

View File

@ -12,10 +12,10 @@ the user never changed the default setting for Spigot's save on stop only.
1.17: TODO does this need the synchronized blocks anymore? 1.17: TODO does this need the synchronized blocks anymore?
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 45bcdf2e644999910784432d8f369e775ce6506d..3e2955013ce75034170b5eeae60482e1c174769d 100644 index 4d5f3509d7be914658014d07c72ec12762a76da3..feab424cbfcb4c8f7ce38cdeeb42dce3fe1ce7aa 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -964,7 +964,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -972,7 +972,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (java.lang.InterruptedException ignored) {} // Paper } catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");
@ -25,10 +25,10 @@ index 45bcdf2e644999910784432d8f369e775ce6506d..3e2955013ce75034170b5eeae60482e1
// Spigot end // Spigot end
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 566390d02b2af4a0f2c867b7ff8116a8301e8497..e2095308a8ec8471b04acce929d314fd828bc3de 100644 index bd94277862e0f5546b4df81fbd535d2e4c7ef5b1..7d834c1b1588851188372eebd9efad9313c610f7 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -256,7 +256,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -257,7 +257,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
if (this.convertOldUsers()) { if (this.convertOldUsers()) {
@ -38,10 +38,10 @@ index 566390d02b2af4a0f2c867b7ff8116a8301e8497..e2095308a8ec8471b04acce929d314fd
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) { if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a9711272994159b96 100644 index 769f2a595f8ca6030c17d5472ee1773063ebe52c..548627b5a12e79ac31136b2695e45f9452115348 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -117,7 +117,7 @@ public class GameProfileCache { @@ -118,7 +118,7 @@ public class GameProfileCache {
return GameProfileCache.usesAuthentication; return GameProfileCache.usesAuthentication;
} }
@ -50,7 +50,7 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
@@ -126,7 +126,7 @@ public class GameProfileCache { @@ -127,14 +127,14 @@ public class GameProfileCache {
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date); GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
this.safeAdd(usercache_usercacheentry); this.safeAdd(usercache_usercacheentry);
@ -59,12 +59,11 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
} }
private long getNextOperation() { private long getNextOperation() {
@@ -134,7 +134,7 @@ public class GameProfileCache { return this.operationCount.incrementAndGet();
} }
@Nullable - public Optional<GameProfile> get(String name) {
- public GameProfile get(String name) { + public synchronized Optional<GameProfile> get(String name) { // Paper - synchronize
+ public synchronized GameProfile get(String name) { // Paper - synchronize
String s1 = name.toLowerCase(Locale.ROOT); String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
boolean flag = false; boolean flag = false;
@ -76,8 +75,8 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
+ this.save(true); // Paper + this.save(true); // Paper
} }
return gameprofile; return optional;
@@ -273,7 +273,7 @@ public class GameProfileCache { @@ -270,7 +270,7 @@ public class GameProfileCache {
return arraylist; return arraylist;
} }
@ -86,7 +85,7 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
JsonArray jsonarray = new JsonArray(); JsonArray jsonarray = new JsonArray();
DateFormat dateformat = GameProfileCache.createDateFormat(); DateFormat dateformat = GameProfileCache.createDateFormat();
@@ -281,6 +281,7 @@ public class GameProfileCache { @@ -278,6 +278,7 @@ public class GameProfileCache {
jsonarray.add(GameProfileCache.writeGameProfile(usercache_usercacheentry, dateformat)); jsonarray.add(GameProfileCache.writeGameProfile(usercache_usercacheentry, dateformat));
}); });
String s = this.gson.toJson(jsonarray); String s = this.gson.toJson(jsonarray);
@ -94,10 +93,11 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
try { try {
BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8); BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
@@ -305,6 +306,14 @@ public class GameProfileCache { @@ -302,7 +303,14 @@ public class GameProfileCache {
} catch (IOException ioexception) { } catch (IOException ioexception) {
; ;
} }
-
+ // Paper start + // Paper start
+ }; + };
+ if (asyncSave) { + if (asyncSave) {
@ -106,6 +106,6 @@ index 1dd9b362384543e17b537dd209665d956214916d..c70b4727fe0ae9ff7b9db08a97112729
+ save.run(); + save.run();
+ } + }
+ // Paper end + // Paper end
} }
private Stream<GameProfileCache.GameProfileInfo> getTopMRUProfiles(int limit) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly Only resize the the redstone torch list once, since resizing arrays / lists is costly
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index fa567322ca3f09d81479826b0119ddc922c41d11..e26cb05a91cf2b3ac059dcb55bc52f1e4f30b362 100644 index 22c4c94a4b81c8ca53d717005b6260f0bafbbea4..6257d002f8ed39065a1a85ff53c6747900e890a5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -159,6 +159,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -160,6 +160,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition; private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't lookup game profiles that have no UUID and no name
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index c70b4727fe0ae9ff7b9db08a9711272994159b96..87f5f4108796aa12b454bbf39b8c1d699bac78f2 100644 index cbdd32685ac12c439e3c94a0432595e3052b2cad..caed3ae480f1937e89153287699473abb5e29e39 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -100,7 +100,7 @@ public class GameProfileCache { @@ -101,7 +101,7 @@ public class GameProfileCache {
repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback); repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get(); GameProfile gameprofile = (GameProfile) atomicreference.get();
@ -16,4 +16,4 @@ index c70b4727fe0ae9ff7b9db08a9711272994159b96..87f5f4108796aa12b454bbf39b8c1d69
+ if (!GameProfileCache.usesAuthentication() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(name)) { // Paper - Don't lookup a profile with a blank name + if (!GameProfileCache.usesAuthentication() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(name)) { // Paper - Don't lookup a profile with a blank name
UUID uuid = Player.createPlayerUUID(new GameProfile((UUID) null, name)); UUID uuid = Player.createPlayerUUID(new GameProfile((UUID) null, name));
gameprofile = new GameProfile(uuid, name); return Optional.of(new GameProfile(uuid, name));

View File

@ -32,10 +32,10 @@ index 1b8e5671c9dc8c15ce33d351c1bb20f28919b9a2..c52dc0346f93527965ef29a0ccdc4bf3
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554 100644 index 7ef77c38537b85deb7d388a7331e895c54a8ba95..6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -97,6 +97,7 @@ public class GameProfileCache { @@ -98,6 +98,7 @@ public class GameProfileCache {
} }
}; };
@ -43,7 +43,7 @@ index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e
repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback); repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get(); GameProfile gameprofile = (GameProfile) atomicreference.get();
@@ -114,7 +115,7 @@ public class GameProfileCache { @@ -115,7 +116,7 @@ public class GameProfileCache {
} }
private static boolean usesAuthentication() { private static boolean usesAuthentication() {
@ -53,10 +53,10 @@ index 87f5f4108796aa12b454bbf39b8c1d699bac78f2..3eb4bee81a8543cc06b9d5898f5f6c0e
public synchronized void add(GameProfile profile) { // Paper - synchronize public synchronized void add(GameProfile profile) { // Paper - synchronize
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index 8e27b43e2f6ce4d7f5007fe02db1722e73c30a58..6aacc724c8c8d6fbe3067226989039ca9cee4929 100644 index f6cb864c45f960811acc02829d1f7883b916de29..8703f97dc2f392b136c6851aa09b607cbfdfa5de 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -65,7 +65,8 @@ public class OldUsersConverter { @@ -66,7 +66,8 @@ public class OldUsersConverter {
return new String[i]; return new String[i];
}); });
@ -67,7 +67,7 @@ index 8e27b43e2f6ce4d7f5007fe02db1722e73c30a58..6aacc724c8c8d6fbe3067226989039ca
} else { } else {
String[] astring1 = astring; String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index be2f148d2b045d704df35b952b03cf88279de64f..2e37c23ce815a5e38ac9b823d187d39057e81ec0 100644 index 6c372692eb6ac813ed071337d6ea98e604133510..94fe09fdf6e477eca467287c68d7a8b5a6fbaee0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1512,7 +1512,7 @@ public final class CraftServer implements Server { @@ -1512,7 +1512,7 @@ public final class CraftServer implements Server {
@ -77,5 +77,5 @@ index be2f148d2b045d704df35b952b03cf88279de64f..2e37c23ce815a5e38ac9b823d187d390
- if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) - if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee )
+ if ( this.getOnlineMode() || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting + if ( this.getOnlineMode() || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting
{ {
profile = this.console.getProfileCache().get( name ); profile = this.console.getProfileCache().get(name).orElse(null);
} }

View File

@ -23,10 +23,10 @@ index c52dc0346f93527965ef29a0ccdc4bf3debe302e..64d7c9058ee757a6d3cf3b648596092a
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8e751e9821dc76f33e9e844990c701f69c817c4b..13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a 100644 index 60772b6d6fe171d7dd832cb132f7c56db9439bdb..451a2ea80c6262008be6b075c122c78a5b435c75 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1496,13 +1496,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1483,13 +1483,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot start - limit place/interactions // Spigot start - limit place/interactions
private int limitedPackets; private int limitedPackets;
private long lastLimitedPacket = -1; private long lastLimitedPacket = -1;

View File

@ -21,10 +21,10 @@ index 64d7c9058ee757a6d3cf3b648596092a810e105c..4e2f243faa209925dcb7c3ef89df3ed8
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a..d05f284b943340fef24481adaa4da4e6d9e0169d 100644 index 451a2ea80c6262008be6b075c122c78a5b435c75..9026dd91f8d874209bbfd4cdfd3c41e37cdd7560 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -302,7 +302,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -301,7 +301,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientIsFloating && !this.player.isSleeping()) { if (this.clientIsFloating && !this.player.isSleeping()) {
if (++this.aboveGroundTickCount > 80) { if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@ -33,7 +33,7 @@ index 13077dcc0ce4e7cfa8146ee71db4c2cce9e36f4a..d05f284b943340fef24481adaa4da4e6
return; return;
} }
} else { } else {
@@ -321,7 +321,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -320,7 +320,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) { if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Auto fix bad Y levels on player login
Bring down to a saner Y level if super high, as this can cause the server to crash Bring down to a saner Y level if super high, as this can cause the server to crash
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index e512cd033317ce2e1437c0ac28f71db47703bc57..3c51b0c3c0cdb55852ca9d9f1609518d5905589a 100644 index a21496bc07c4691b99f9f58a0493e6e054c02641..d5bdf1e58bf48b5738e98159afb54630220af5b0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -401,6 +401,7 @@ public class ServerPlayer extends Player { @@ -397,6 +397,7 @@ public class ServerPlayer extends Player {
@Override @Override
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt); super.readAdditionalSaveData(nbt);

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 69f74f6e9750b34e735c8fe68a90a3f1e0eed2fb..c85caffd2dcb47d127b508791f78aea8f3657c8d 100644 index 6257d002f8ed39065a1a85ff53c6747900e890a5..05f94017546f3bb326f445d06add401498524d4d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -316,6 +316,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -317,6 +317,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition); return chunk == null ? null : chunk.getFluidState(blockposition);
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty()
Remove hashMap lookup every check, simplify code to remove ternary Remove hashMap lookup every check, simplify code to remove ternary
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index bbaf615a150bc9c1ad61d509209350eec922a9f2..55e2ac3fc3d6e1da40f766ac42c9ca24b8b6e872 100644 index 7a50160c2cace5ef7a2f1f3834574e389fd32aaa..404a9f22b3a67aa042449fa2c1a1c31095c256b9 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -241,7 +241,7 @@ public final class ItemStack { @@ -239,7 +239,7 @@ public final class ItemStack {
} }
public boolean isEmpty() { public boolean isEmpty() {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3c51b0c3c0cdb55852ca9d9f1609518d5905589a..a580ac8a39612f7b2cc9aad2815e987d4ba77b42 100644 index d5bdf1e58bf48b5738e98159afb54630220af5b0..823fc38b5bbf5eac2d2e7cc48c4b0557d252f960 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2117,7 +2117,7 @@ public class ServerPlayer extends Player { @@ -2123,7 +2123,7 @@ public class ServerPlayer extends Player {
@Override @Override
public boolean isImmobile() { public boolean isImmobile() {
@ -19,10 +19,10 @@ index 3c51b0c3c0cdb55852ca9d9f1609518d5905589a..a580ac8a39612f7b2cc9aad2815e987d
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d05f284b943340fef24481adaa4da4e6d9e0169d..a6891c43b674919eecaac5e826b4d979478b300c 100644 index 9026dd91f8d874209bbfd4cdfd3c41e37cdd7560..6eb01dcf59fda2656b6d93b0c39380302665f930 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2822,7 +2822,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2810,7 +2810,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} }
public final boolean isDisconnected() { public final boolean isDisconnected() {

View File

@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads. the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9cd5ed55c8ee13412662a2d7a5b636833e3a813e..3485538af8de78df47b03331c211e0015c214304 100644 index a9ab9bba799a95351cdb829b84163a564b41e0a8..b08b11bfbc3441fc2899a5e72d7a388383781955 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1033,11 +1033,13 @@ public abstract class PlayerList { @@ -1035,11 +1035,13 @@ public abstract class PlayerList {
} }
public void saveAll() { public void saveAll() {

View File

@ -129,10 +129,10 @@ index 4000480a14d2ba52149f4fa47f824abfa2e0e5f8..ea01f84448693ca740b5f3381a9c500e
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2654ff0b458df689d1d27f9e4d3e3b56dc1296da..70804eb057cc7d6605e045baf6b9ffdb8cb2d477 100644 index 60f966b56adcc232fe8c53ec0a04e69c93f0765d..a3dae798fe63e21f86a380f09ba802b2104ad7e8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1699,7 +1699,8 @@ public abstract class LivingEntity extends Entity { @@ -1703,7 +1703,8 @@ public abstract class LivingEntity extends Entity {
protected void dropExperience() { protected void dropExperience() {
// CraftBukkit start - Update getExpReward() above if the removed if() changes! // CraftBukkit start - Update getExpReward() above if the removed if() changes!
if (true) { if (true) {
@ -156,7 +156,7 @@ index b8163a04f5aad326e78416b270dc64ffc913ccc5..5a503a255b4e7e684a8f42d819043039
// CraftBukkit end // CraftBukkit end
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index 0fd1dfacca88cd5399e05cb7ebc0150491e8f59c..c1cdb1905536bda76f34ad3fc796996443839767 100644 index 0ebf49f7f1046b0606f3608bcc8e496693fe8553..3d15587a8c36d833283cfea0546c589287e7ed48 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -883,7 +883,7 @@ public class Fox extends Animal { @@ -883,7 +883,7 @@ public class Fox extends Animal {
@ -182,7 +182,7 @@ index bae8340abda9f400450c835946b30aacec261f6d..fa551b1338a21b7b0864bdb9f31cb365
} }
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index 9d5b78880ea9d7efb8a6c5ffa26122e08b45f494..401a105a161c23a8d3fe45d0a7c845072afb8bd9 100644 index e17cf38b791f509447ce2c8ef38411530a0fb09b..3a01ffffcc37a93866b8b6774874959dfcabba26 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -634,7 +634,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -634,7 +634,7 @@ public class EnderDragon extends Mob implements Enemy {
@ -204,7 +204,7 @@ index 9d5b78880ea9d7efb8a6c5ffa26122e08b45f494..401a105a161c23a8d3fe45d0a7c84507
if (this.dragonFight != null) { if (this.dragonFight != null) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index a8820e811be1adecf864541400dc6907d3c2f0bb..32132911f3431c7d1390edbc69bf4b98e123a713 100644 index f030c8d7c28039fde273e6b30c63ea791c8de520..b4a3469d85a388100092cc2a1305cdcae37df9fc 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -616,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -616,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@ -256,7 +256,7 @@ index 467f9814e0991d31bff7259f266262c81328f05f..11d1db5ef709dfb6fa596ebc4f5fff14
} }
diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b9811a3cb0d 100644 index c5e4a0aa901d362cb299298fe2426c1c8f546ece..b268645827b7a57b906fd925d694f802a75da25d 100644
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
@@ -98,7 +98,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -98,7 +98,7 @@ public class GrindstoneMenu extends AbstractContainerMenu {
@ -269,7 +269,7 @@ index 473e17d87637cd1a85880e2956f83de0b510b488..34574f3945d2a7b4ab6a71adb2408b98
world.levelEvent(1042, blockposition, 0); world.levelEvent(1042, blockposition, 0);
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index c27e755f93a2b2e203b305e0cae2c782a34e38cc..27016f964d2f6458298a9052d031a44b3d9f5f4b 100644 index 72ef08a59dbf72bec2ce54ab76455c4230395959..6a31e3a3466369ede28e28bc3b9fda8dcb77e136 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -374,8 +374,13 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -374,8 +374,13 @@ public class Block extends BlockBehaviour implements ItemLike {
@ -288,7 +288,7 @@ index c27e755f93a2b2e203b305e0cae2c782a34e38cc..27016f964d2f6458298a9052d031a44b
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 740cabab47b80ea6eef2761ef14f5960ff309569..cfa095d39843dd4963c817b824228a4b48a8c1cd 100644 index 98633fe921a30e89715a62ca39b77347a96e5fd7..e43fd7185b4570713d8ee2361d633c94d187fe2b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -610,7 +610,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -610,7 +610,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit

View File

@ -27,7 +27,7 @@ index 2dc58b9f769ea43b737804456aafab47ecc143b8..c611b5a63498f5ad1f50a75ccd5d7299
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7f080d8aac9198dd935a8af090ee82f618551203..927cc59705c662d319fbee47c8da00d8e6256e72 100644 index 5acc5d9150961223904b8d0bb9ea880feb60ebf5..01cfa488e7b25b7c65e71908bb6f5e6b7b61ca89 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@ -39,10 +39,10 @@ index 7f080d8aac9198dd935a8af090ee82f618551203..927cc59705c662d319fbee47c8da00d8
// Spigot end // Spigot end
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 70804eb057cc7d6605e045baf6b9ffdb8cb2d477..8044082ed3ca6076af38e4299e50f1f690d02a72 100644 index a3dae798fe63e21f86a380f09ba802b2104ad7e8..489ce149e1922ef4bd09716dee079c0cc5aa1de2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3224,8 +3224,11 @@ public abstract class LivingEntity extends Entity { @@ -3227,8 +3227,11 @@ public abstract class LivingEntity extends Entity {
} }
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f652f8ea615 100644 index 82b25044e1852f5dbde1a658fe5f4f7526fa2b34..5ce8ac377b0d2b05dd90baa67f420945cc419609 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -185,7 +185,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -185,7 +185,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -15,9 +15,9 @@ index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f65
- this.unloadQueue = Queues.newConcurrentLinkedQueue(); - this.unloadQueue = Queues.newConcurrentLinkedQueue();
+ this.unloadQueue = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Paper - need constant-time size() + this.unloadQueue = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Paper - need constant-time size()
this.structureManager = structureManager; this.structureManager = structureManager;
this.storageFolder = session.getDimensionPath(world.dimension()); File file = session.getDimensionPath(world.dimension());
this.level = world;
@@ -478,7 +478,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -479,7 +479,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Spigot start // Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.level.getServer().slackActivityAccountant; org.spigotmc.SlackActivityAccountant activityAccountant = this.level.getServer().slackActivityAccountant;
activityAccountant.startActivity(0.5); activityAccountant.startActivity(0.5);
@ -26,7 +26,7 @@ index b20c1a772abdbadb72f141a751e954b126ab3de9..f4f0982aa11da0b5bf88a42c02e86f65
// Spigot end // Spigot end
while (longiterator.hasNext()) { // Spigot while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong(); long j = longiterator.nextLong();
@@ -500,7 +500,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -501,7 +501,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
Runnable runnable; Runnable runnable;

View File

@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss. in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fbe6ddda15 100644 index feab424cbfcb4c8f7ce38cdeeb42dce3fe1ce7aa..14d94990ca8160b0a28b40ae6b8261f50798d7a2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -233,6 +233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -230,6 +230,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final Map<ResourceKey<Level>, ServerLevel> levels; public final Map<ResourceKey<Level>, ServerLevel> levels;
private PlayerList playerList; private PlayerList playerList;
private volatile boolean running; private volatile boolean running;
@ -41,7 +41,7 @@ index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fb
private boolean stopped; private boolean stopped;
private int tickCount; private int tickCount;
protected final Proxy proxy; protected final Proxy proxy;
@@ -917,7 +918,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -925,7 +926,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.playerList != null) { if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.playerList.saveAll(); this.playerList.saveAll();
@ -50,7 +50,7 @@ index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fb
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
} }
@@ -983,6 +984,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -991,6 +992,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void halt(boolean flag) { public void halt(boolean flag) {
@ -64,10 +64,10 @@ index 1d70c8b6c807b92a2411f5dd46bf616cb8d05569..3875a2902c6a737fed4e2df3f7aee8fb
if (flag) { if (flag) {
try { try {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 3485538af8de78df47b03331c211e0015c214304..2c24e800094d425b40361f8729a03393861f723a 100644 index b08b11bfbc3441fc2899a5e72d7a388383781955..24add1cd1f865012c5382548e415218d481ecefe 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1139,8 +1139,15 @@ public abstract class PlayerList { @@ -1141,8 +1141,15 @@ public abstract class PlayerList {
} }
public void removeAll() { public void removeAll() {

View File

@ -26,10 +26,10 @@ index c611b5a63498f5ad1f50a75ccd5d7299e27df7e3..9d1cddc6038f0fd0286e4a32013ae98f
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 079b3c124308c2711ab76506c856d95e2ac81c3a..98640f6000067b49e1c15740d45dc29e62b7f249 100644 index 6eb01dcf59fda2656b6d93b0c39380302665f930..41f1b355a8a90216964e89432244a7d6929c9152 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2057,6 +2057,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2044,6 +2044,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
switch (packet.getAction()) { switch (packet.getAction()) {
case PRESS_SHIFT_KEY: case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true); this.player.setShiftKeyDown(true);
@ -44,7 +44,7 @@ index 079b3c124308c2711ab76506c856d95e2ac81c3a..98640f6000067b49e1c15740d45dc29e
case RELEASE_SHIFT_KEY: case RELEASE_SHIFT_KEY:
this.player.setShiftKeyDown(false); this.player.setShiftKeyDown(false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 33a61c0ab7e6ed03030bdd8d8635d989b28bd169..56ce24ab7213776285d09cc0ab91f012d3e58caf 100644 index c825ad2d04b964561355cb0564f9f5507848217f..273bb051c3f19e388ccea367ef6b46b509015abd 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -579,7 +579,7 @@ public abstract class Player extends LivingEntity { @@ -579,7 +579,7 @@ public abstract class Player extends LivingEntity {

View File

@ -19,7 +19,7 @@ Other changes:
configuration configuration
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 74bde15e021f306a2f1247678f92becbdce313b8..168728c96f8a8aaf5912f4d70cb5939daeb9cb27 100644 index 5574354bc3422b0c3a2623e2b16565a6b80cadc7..05bc50229dcdcf173918a04e0e0ecaffb07e04a2 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -19,7 +19,17 @@ repositories { @@ -19,7 +19,17 @@ repositories {
@ -112,18 +112,18 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f622715343348cdf4 100644 index 14d94990ca8160b0a28b40ae6b8261f50798d7a2..34e801e225173246ba6f4c2ab68ef3f5f2278d78 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -12,6 +12,7 @@ import com.mojang.datafixers.DataFixer; @@ -9,6 +9,7 @@ import com.mojang.authlib.GameProfile;
import io.netty.buffer.ByteBuf; import com.mojang.authlib.GameProfileRepository;
import io.netty.buffer.ByteBufOutputStream; import com.mojang.authlib.minecraft.MinecraftSessionService;
import io.netty.buffer.Unpooled; import com.mojang.datafixers.DataFixer;
+import io.papermc.paper.adventure.PaperAdventure; // Paper +import io.papermc.paper.adventure.PaperAdventure; // Paper
import it.unimi.dsi.fastutil.longs.LongIterator; import it.unimi.dsi.fastutil.longs.LongIterator;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -172,7 +173,7 @@ import org.apache.logging.log4j.Logger; @@ -169,7 +170,7 @@ import org.apache.logging.log4j.Logger;
import com.mojang.serialization.DynamicOps; import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle; import com.mojang.serialization.Lifecycle;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -132,7 +132,7 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
import joptsimple.OptionSet; import joptsimple.OptionSet;
import net.minecraft.resources.RegistryReadOps; import net.minecraft.resources.RegistryReadOps;
import net.minecraft.server.bossevents.CustomBossEvents; import net.minecraft.server.bossevents.CustomBossEvents;
@@ -287,7 +288,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -283,7 +284,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public OptionSet options; public OptionSet options;
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
@ -141,7 +141,7 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
public static int currentTick = 0; // Paper - Further improve tick loop public static int currentTick = 0; // Paper - Further improve tick loop
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
@@ -365,7 +366,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -361,7 +362,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.options = options; this.options = options;
this.datapackconfiguration = datapackconfiguration; this.datapackconfiguration = datapackconfiguration;
this.vanillaCommandDispatcher = datapackresources.commands; // CraftBukkit this.vanillaCommandDispatcher = datapackresources.commands; // CraftBukkit
@ -151,7 +151,7 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
if (System.console() == null && System.getProperty("jline.terminal") == null) { if (System.console() == null && System.getProperty("jline.terminal") == null) {
System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
Main.useJline = false; Main.useJline = false;
@@ -386,6 +389,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -382,6 +385,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.warn((String) null, ex); MinecraftServer.LOGGER.warn((String) null, ex);
} }
} }
@ -160,7 +160,7 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
} }
// CraftBukkit end // CraftBukkit end
@@ -1160,7 +1165,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1168,7 +1173,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Spigot org.spigotmc.WatchdogThread.doStop(); // Spigot
// CraftBukkit start - Restore terminal to original settings // CraftBukkit start - Restore terminal to original settings
try { try {
@ -169,7 +169,7 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
} catch (Exception ignored) { } catch (Exception ignored) {
} }
// CraftBukkit end // CraftBukkit end
@@ -1549,7 +1554,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1551,7 +1556,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public void sendMessage(Component message, UUID sender) { public void sendMessage(Component message, UUID sender) {
@ -179,10 +179,10 @@ index 3875a2902c6a737fed4e2df3f7aee8fbe6ddda15..cedf31670e65bd7f7ed62e8f62271534
public KeyPair getKeyPair() { public KeyPair getKeyPair() {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf714959950e 100644 index 7d834c1b1588851188372eebd9efad9313c610f7..967552df9d5ae7e58bb39127e1adb51bbf49dc28 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -108,6 +108,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -109,6 +109,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (!org.bukkit.craftbukkit.Main.useConsole) { if (!org.bukkit.craftbukkit.Main.useConsole) {
return; return;
} }
@ -192,7 +192,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71
jline.console.ConsoleReader bufferedreader = reader; jline.console.ConsoleReader bufferedreader = reader;
// MC-33041, SPIGOT-5538: if System.in is not valid due to javaw, then return // MC-33041, SPIGOT-5538: if System.in is not valid due to javaw, then return
@@ -139,7 +142,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -140,7 +143,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
continue; continue;
} }
if (s.trim().length() > 0) { // Trim to filter lines which are just spaces if (s.trim().length() > 0) { // Trim to filter lines which are just spaces
@ -201,7 +201,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71
} }
// CraftBukkit end // CraftBukkit end
} }
@@ -147,6 +150,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -148,6 +151,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.error("Exception handling console input", ioexception); DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
} }
@ -210,7 +210,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71
} }
}; };
@@ -158,6 +163,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -159,6 +164,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler());
@ -220,7 +220,7 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71
final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger());
for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) { for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) {
if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) { if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) {
@@ -166,6 +174,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -167,6 +175,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader).start(); new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader).start();
@ -230,10 +230,10 @@ index e2095308a8ec8471b04acce929d314fd828bc3de..45ae21718df16e16b5a3835a92afbf71
System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream()); System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream());
System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream()); System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2c24e800094d425b40361f8729a03393861f723a..992760580450a9b0e8dc226b73ba0b29707ec04e 100644 index 24add1cd1f865012c5382548e415218d481ecefe..31dccb0b4ab60d6cedf236fc7d51a363c8367d71 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -152,8 +152,7 @@ public abstract class PlayerList { @@ -154,8 +154,7 @@ public abstract class PlayerList {
public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) { public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this); this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
@ -244,7 +244,7 @@ index 2c24e800094d425b40361f8729a03393861f723a..992760580450a9b0e8dc226b73ba0b29
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e11d454da896d52fe2a0d1d90027ed539b847911..e95a01e582b6c8996f4b366f5fd9b783658e6bff 100644 index dadb60f0a1d8d0753e030ed9fd5f4235083e7808..914d2e16dd47db5a44b738d4c45af24b22ff0c2b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -46,7 +46,6 @@ import java.util.function.Consumer; @@ -46,7 +46,6 @@ import java.util.function.Consumer;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 18ea26c8e17da03f35c3fd0788a385cc492ff544..85633cd1718783cffe03f750da1c17270eeb4cdd 100644 index 78e2d0165f6f6da4d7d1e1dad76e5edcbe48df9e..6b18d4dd869b442f06a7e9ae690edd5ff5227cbb 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -614,6 +614,11 @@ public abstract class Mob extends LivingEntity { @@ -615,6 +615,11 @@ public abstract class Mob extends LivingEntity {
ItemEntity entityitem = (ItemEntity) iterator.next(); ItemEntity entityitem = (ItemEntity) iterator.next();
if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) { if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) {

View File

@ -7,14 +7,12 @@ Establishes base extension of profile systems for future edits too
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c6996cbc349a index 0000000000000000000000000000000000000000..84551164b76bc8f064a3a0c030c3a1b47f567b6f
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -0,0 +1,303 @@ @@ -0,0 +1,302 @@
+package com.destroystokyo.paper.profile; +package com.destroystokyo.paper.profile;
+ +
+import com.destroystokyo.paper.profile.PlayerProfile;
+import com.destroystokyo.paper.profile.ProfileProperty;
+import com.destroystokyo.paper.PaperConfig; +import com.destroystokyo.paper.PaperConfig;
+import com.google.common.base.Charsets; +import com.google.common.base.Charsets;
+import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfile;
@ -24,7 +22,6 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699
+import net.minecraft.server.players.GameProfileCache; +import net.minecraft.server.players.GameProfileCache;
+import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.Validate;
+import org.bukkit.craftbukkit.entity.CraftPlayer; +import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.spigotmc.SpigotConfig;
+ +
+import javax.annotation.Nonnull; +import javax.annotation.Nonnull;
+import javax.annotation.Nullable; +import javax.annotation.Nullable;
@ -32,6 +29,7 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699
+import java.util.Collection; +import java.util.Collection;
+import java.util.Iterator; +import java.util.Iterator;
+import java.util.Objects; +import java.util.Objects;
+import java.util.Optional;
+import java.util.Set; +import java.util.Set;
+import java.util.UUID; +import java.util.UUID;
+ +
@ -166,7 +164,7 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699
+ if (profile.getId() == null) { + if (profile.getId() == null) {
+ final GameProfile profile; + final GameProfile profile;
+ if (onlineMode) { + if (onlineMode) {
+ profile = lookupUUID ? userCache.get(name) : userCache.getProfileIfCached(name); + profile = lookupUUID ? userCache.get(name).orElse(null) : userCache.getProfileIfCached(name);
+ } else { + } else {
+ // Make an OfflinePlayer using an offline mode UUID since the name has no profile + // Make an OfflinePlayer using an offline mode UUID since the name has no profile
+ profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name);
@ -179,8 +177,9 @@ index 0000000000000000000000000000000000000000..ef6aab69daa7ab952408b573bff6c699
+ } + }
+ +
+ if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) { + if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) {
+ GameProfile profile = userCache.get(this.profile.getId()); + Optional<GameProfile> optProfile = userCache.get(this.profile.getId());
+ if (profile != null) { + if (optProfile.isPresent()) {
+ GameProfile profile = optProfile.get();
+ if (this.profile.getName() == null) { + if (this.profile.getName() == null) {
+ // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't + // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't
+ copyProfileProperties(this.profile, profile); + copyProfileProperties(this.profile, profile);
@ -474,11 +473,11 @@ index c8385460701395cb5c65fba41335469ffb2d9b9a..fb0b3c5770f66cc3590f5ac4e690a33c
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName())); GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..9a428e166561b4bc028732ec563d3b2e99f81a8e 100644 index 6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7..61405c2b53e03a4b83e2c70c6e4d3739ca9676cb 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -190,6 +190,13 @@ public class GameProfileCache { @@ -135,6 +135,13 @@ public class GameProfileCache {
} return this.operationCount.incrementAndGet();
} }
+ // Paper start + // Paper start
@ -488,11 +487,11 @@ index 3eb4bee81a8543cc06b9d5898f5f6c0e9dbbf554..9a428e166561b4bc028732ec563d3b2e
+ } + }
+ // Paper end + // Paper end
+ +
@Nullable public synchronized Optional<GameProfile> get(String name) { // Paper - synchronize
public GameProfile get(UUID uuid) { String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByUUID.get(uuid); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a3e57ee42a76ec419ad055b4e353f1ca54470af0..d221bad83f1bf2d9f23e457427c15b440e945f42 100644 index 8667373de82ce335fb0c55e39e6c1e1e791d70ce..df03db15e0a7d90ada2ae2a7990472ec2ca72806 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -226,6 +226,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -226,6 +226,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 56ce24ab7213776285d09cc0ab91f012d3e58caf..64f916d290df16ecab9ccb8fa029839360b4f4c6 100644 index 273bb051c3f19e388ccea367ef6b46b509015abd..789a42f997d5f0abf50171db7d747092653817fa 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1953,20 +1953,44 @@ public abstract class Player extends LivingEntity { @@ -1949,20 +1949,44 @@ public abstract class Player extends LivingEntity {
} }
@ -58,7 +58,7 @@ index 56ce24ab7213776285d09cc0ab91f012d3e58caf..64f916d290df16ecab9ccb8fa0298393
@Override @Override
public abstract boolean isSpectator(); public abstract boolean isSpectator();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 2db149bf57c561d7f8f49341fbefafb5d3ecab54..bddfc12e8cf896bee5fb518ddacdca434456c6bb 100644 index 841dbf4a86b19d7c8ea41930ecb1f88c660fa117..54947f02f29dd3dc546ee0d0f4600630242f003d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -500,6 +500,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -500,6 +500,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {

View File

@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations. to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 8f05c6832fc968666f0e6e0a19f6dd74d92d0c28..69852a3801439db075e522aa2e2dc51e84c3deda 100644 index 4b038b7f4176dc1a1a47d7694d95ce0e4ec38a2d..10c09dc9228b1eec784a508c6c0e7a229aab7924 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -349,5 +349,11 @@ public final class CraftItemFactory implements ItemFactory { @@ -352,5 +352,11 @@ public final class CraftItemFactory implements ItemFactory {
public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) { public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName());
} }

View File

@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar. You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 69852a3801439db075e522aa2e2dc51e84c3deda..001e89e85fb935c539c53c8e9c78927e26e099d8 100644 index 10c09dc9228b1eec784a508c6c0e7a229aab7924..8f5d71463616e519c2e183af1c2909fd55a3f93a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -355,5 +355,18 @@ public final class CraftItemFactory implements ItemFactory { @@ -358,5 +358,18 @@ public final class CraftItemFactory implements ItemFactory {
public ItemStack ensureServerConversions(ItemStack item) { public ItemStack ensureServerConversions(ItemStack item) {
return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item)); return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 992760580450a9b0e8dc226b73ba0b29707ec04e..9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f 100644 index 31dccb0b4ab60d6cedf236fc7d51a363c8367d71..1ae11a88b2ab49c13155e2cf41252c8716f30b96 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -613,9 +613,9 @@ public abstract class PlayerList { @@ -615,9 +615,9 @@ public abstract class PlayerList {
// return chatmessage; // return chatmessage;
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure
@ -21,7 +21,7 @@ index 992760580450a9b0e8dc226b73ba0b29707ec04e..9f27c6fa106a11ea56a4be2d41f8a00f
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
@@ -995,9 +995,25 @@ public abstract class PlayerList { @@ -997,9 +997,25 @@ public abstract class PlayerList {
this.server.getCommands().sendCommands(player); this.server.getCommands().sendCommands(player);
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 98640f6000067b49e1c15740d45dc29e62b7f249..9255e3d89385fac82a1a2f27bd915cbbd19f69e7 100644 index 41f1b355a8a90216964e89432244a7d6929c9152..7759bf2afb9edeaca24726aace9358a8d5eafc64 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1187,7 +1187,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1174,7 +1174,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag = d8 > 0.0D; boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) { if (this.player.isOnGround() && !packet.isOnGround() && flag) {

View File

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9255e3d89385fac82a1a2f27bd915cbbd19f69e7..20084d956082d4656f50c4e5e5f2b1c1a9cb9cbc 100644 index 7759bf2afb9edeaca24726aace9358a8d5eafc64..652703b1582e63148658a3a9d2604afa55674c23 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2781,14 +2781,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2769,14 +2769,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

View File

@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer. at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe88a83329 100644 index 652703b1582e63148658a3a9d2604afa55674c23..cf42d59254f2786bfe8785249ad270d35996417a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -222,9 +222,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -221,9 +221,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server; private final MinecraftServer server;
public ServerPlayer player; public ServerPlayer player;
private int tickCount; private int tickCount;
@ -33,7 +33,7 @@ index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe
// CraftBukkit start - multithreaded fields // CraftBukkit start - multithreaded fields
private AtomicInteger chatSpamTickCount = new AtomicInteger(); private AtomicInteger chatSpamTickCount = new AtomicInteger();
// CraftBukkit end // CraftBukkit end
@@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -252,6 +252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private int aboveGroundVehicleTickCount; private int aboveGroundVehicleTickCount;
private int receivedMovePacketCount; private int receivedMovePacketCount;
private int knownMovePacketCount; private int knownMovePacketCount;
@ -41,7 +41,7 @@ index e06179ca9c26368e47ef819f2e7bdf59518842f5..a679b30076cec74976cd04a7fab737fe
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server; this.server = server;
@@ -335,18 +336,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -334,18 +335,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} }
this.server.getProfiler().push("keepAlive"); this.server.getProfiler().push("keepAlive");

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e37d4dd9a 100644 index 789a42f997d5f0abf50171db7d747092653817fa..615ed6c07a3c20f0bd6b58f7d260e12d34b7ab0a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent; @@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent;
@ -17,7 +17,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e
import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
@@ -1183,7 +1184,7 @@ public abstract class Player extends LivingEntity { @@ -1179,7 +1180,7 @@ public abstract class Player extends LivingEntity {
int i = b0 + EnchantmentHelper.getKnockbackBonus((LivingEntity) this); int i = b0 + EnchantmentHelper.getKnockbackBonus((LivingEntity) this);
if (this.isSprinting() && flag) { if (this.isSprinting() && flag) {
@ -26,7 +26,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e
++i; ++i;
flag1 = true; flag1 = true;
} }
@@ -1258,7 +1259,7 @@ public abstract class Player extends LivingEntity { @@ -1254,7 +1255,7 @@ public abstract class Player extends LivingEntity {
} }
} }
@ -35,7 +35,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e
this.sweepAttack(); this.sweepAttack();
} }
@@ -1286,15 +1287,15 @@ public abstract class Player extends LivingEntity { @@ -1282,15 +1283,15 @@ public abstract class Player extends LivingEntity {
} }
if (flag2) { if (flag2) {
@ -54,7 +54,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e
} }
} }
@@ -1346,7 +1347,7 @@ public abstract class Player extends LivingEntity { @@ -1342,7 +1343,7 @@ public abstract class Player extends LivingEntity {
this.applyExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value this.applyExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
} else { } else {
@ -63,7 +63,7 @@ index 64f916d290df16ecab9ccb8fa029839360b4f4c6..eb71f050fcd673ee4d9d1da62e098e2e
if (flag4) { if (flag4) {
target.clearFire(); target.clearFire();
} }
@@ -1793,6 +1794,14 @@ public abstract class Player extends LivingEntity { @@ -1789,6 +1790,14 @@ public abstract class Player extends LivingEntity {
public int getXpNeededForNextLevel() { public int getXpNeededForNextLevel() {
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 8044082ed3ca6076af38e4299e50f1f690d02a72..0dc03f53c80aac91a914bea91958a6c11c4f2061 100644 index 489ce149e1922ef4bd09716dee079c0cc5aa1de2..4da63e5c35b1736f2d55713b39b64cc31ecbc9c9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 8044082ed3ca6076af38e4299e50f1f690d02a72..0dc03f53c80aac91a914bea91958a6c1
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
@@ -2937,6 +2938,13 @@ public abstract class LivingEntity extends Entity { @@ -2940,6 +2941,13 @@ public abstract class LivingEntity extends Entity {
ItemStack itemstack1 = this.getItemBySlot(enumitemslot); ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
if (!ItemStack.matches(itemstack1, itemstack)) { if (!ItemStack.matches(itemstack1, itemstack)) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1debf03ed5 100644 index 43febeede5fcc9d52e6682f94afb26c18b61648e..68f6b8fee64b1c0cb6968d69f7edcfb48119aa46 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -723,6 +723,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -728,6 +728,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start // Spigot start
// Iterator iterator = this.blockEntityTickers.iterator(); // Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0; int tilesThisCycle = 0;
@ -17,7 +17,7 @@ index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1d
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition); TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
@@ -730,7 +732,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -735,7 +737,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity == null) { if (tickingblockentity == null) {
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
tilesThisCycle--; tilesThisCycle--;
@ -25,7 +25,7 @@ index 5b88064b42012f7480adcc9e77da7017347db5af..30347baabcace53bcad0b6ffddab9f1d
continue; continue;
} }
// Spigot end // Spigot end
@@ -738,12 +739,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -743,12 +744,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) { if (tickingblockentity.isRemoved()) {
// Spigot start // Spigot start
tilesThisCycle--; tilesThisCycle--;

View File

@ -18,11 +18,11 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled. information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278542809f0 100644 index 68f6b8fee64b1c0cb6968d69f7edcfb48119aa46..e83ad85f2350da4a01fd0c848a821d556c7ea9b2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -140,7 +140,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -141,7 +141,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false; public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false; public boolean captureTreeGeneration = false;
- public Map<BlockPos, CapturedBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); - public Map<BlockPos, CapturedBlockState> capturedBlockStates = new java.util.LinkedHashMap<>();
@ -30,7 +30,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>(); public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
public List<ItemEntity> captureDrops; public List<ItemEntity> captureDrops;
public long ticksPerAnimalSpawns; public long ticksPerAnimalSpawns;
@@ -358,7 +358,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -359,7 +359,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {
@ -39,7 +39,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278
if (blockstate == null) { if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate); this.capturedBlockStates.put(pos.immutable(), blockstate);
@@ -378,7 +378,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -379,7 +379,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start - capture blockstates // CraftBukkit start - capture blockstates
boolean captured = false; boolean captured = false;
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) { if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
@ -49,7 +49,7 @@ index 30347baabcace53bcad0b6ffddab9f1debf03ed5..08f612b7d2e861ef7e8b91e622c7a278
this.capturedBlockStates.put(pos.immutable(), blockstate); this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true; captured = true;
} }
@@ -643,7 +644,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -648,7 +649,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {

View File

@ -14,10 +14,10 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98accfcc6bd28 100644 index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8902f5765 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -703,10 +703,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -702,10 +702,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
@ -30,7 +30,7 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc
return; return;
} }
// CraftBukkit end // CraftBukkit end
@@ -716,12 +716,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -715,12 +715,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
stringreader.skip(); stringreader.skip();
} }
@ -46,14 +46,14 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc
+ // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server + // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server
+ if (!event.isHandled()) { + if (!event.isHandled()) {
+ if (!event.isCancelled()) { + if (!event.isCancelled()) {
+
+ this.server.scheduleOnMain(() -> { // Paper - This needs to be on main
+ ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
- this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { - this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
- if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer - if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer
- this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); - this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions));
- }); - });
+ this.server.scheduleOnMain(() -> { // Paper - This needs to be on main
+ ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
+
+ this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { + this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
+ if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer + if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer
+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); + this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions));
@ -72,7 +72,7 @@ index b91362681a3293e1acd044edad34e1e86e36d0f3..e12f0af47108b09e490f2a1e51a98acc
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d221bad83f1bf2d9f23e457427c15b440e945f42..7a1c83403f4f6a0eae54c067e1866de7971e0ef2 100644 index c9de4bda38ae28067b03ceef2e2a6972a6920370..40b0489faa4da7888addfd2a028bbf1e7578e6be 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1856,7 +1856,7 @@ public final class CraftServer implements Server { @@ -1856,7 +1856,7 @@ public final class CraftServer implements Server {

View File

@ -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. Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..e246bf034a86deba5a15e7c639f5e08213fe7eee 100644 index 6f25e9f41d93a225acaa6575954967438a6cabbf..d439e8ce87bf7da03683a336941c7673b8b166e4 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
@@ -246,8 +246,11 @@ public class EnchantmentHelper { @@ -270,8 +270,11 @@ public class EnchantmentHelper {
return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0; return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0;
} }
@ -28,7 +28,7 @@ index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..e246bf034a86deba5a15e7c639f5e082
return true; return true;
}); });
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6549ffa087f9955849024fa62cfca9e91cbecf30..f1c56823e1e89251c518d9d51ab7442b30a85336 100644 index a4063d3c280b145c9754c6df22b0b458f7145ea7..c240910d1baadc40a66e4086fb41cb5aee1eabc6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer; @@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer;

View File

@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 229e08a3fd8b4fc026ff49af9d163ea26d878bd4..94c5577a887ab4801dae5a1a0accd4b2f448bcc2 100644 index 5ce8ac377b0d2b05dd90baa67f420945cc419609..919a489a5c7b338659c62ae67fc0a6ceee9dcdf9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -974,11 +974,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -975,11 +975,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@ -36,10 +36,10 @@ index 229e08a3fd8b4fc026ff49af9d163ea26d878bd4..94c5577a887ab4801dae5a1a0accd4b2
}); });
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index e3abeb839c36b5238ec115329ce05b58e3383a55..853056ad5c5eeff03e7d6fe0dfd6f837a03ad882 100644 index 672c6651043a4efd65e472bbd519f54861ec008a..6757971ee556da2470de8b4579d906452acd36fe 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -632,6 +632,15 @@ public class ServerChunkCache extends ChunkSource { @@ -631,6 +631,15 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().pop(); this.level.getProfiler().pop();
//List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
//Collections.shuffle(list); // Paper //Collections.shuffle(list); // Paper
@ -56,7 +56,7 @@ index e3abeb839c36b5238ec115329ce05b58e3383a55..853056ad5c5eeff03e7d6fe0dfd6f837
this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no... this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no...
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a580ac8a39612f7b2cc9aad2815e987d4ba77b42..83a2c8e00d8445ad66bb8360f4e0e4b7cba44bb3 100644 index 823fc38b5bbf5eac2d2e7cc48c4b0557d252f960..fb42d7e3a1a23c02e8fd2cc04e6986ead581018c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -66,7 +66,7 @@ index a580ac8a39612f7b2cc9aad2815e987d4ba77b42..83a2c8e00d8445ad66bb8360f4e0e4b7
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.datafixers.util.Either; import com.mojang.datafixers.util.Either;
@@ -232,6 +233,7 @@ public class ServerPlayer extends Player { @@ -233,6 +234,7 @@ public class ServerPlayer extends Player {
public boolean sentListPacket = false; public boolean sentListPacket = false;
public Integer clientViewDistance; public Integer clientViewDistance;
// CraftBukkit end // CraftBukkit end

View File

@ -256,10 +256,10 @@ index aee796567f11c8b93ac9ec0b8cb8f3a8412b23ce..39b98305632271e7375afe6c7001f241
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 45f4f8265c51a5b08db8aa7f53915c4bd0536d39..4ad6fd7e110f949f0bd859331ed6a5109ade3008 100644 index 05d54f0eff89b721f01e90e79d2571baab297799..71320d9484842be3a694117de25159f3581bd2a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1442,6 +1442,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1444,6 +1444,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaCrossbow.CHARGED.NBT, CraftMetaCrossbow.CHARGED.NBT,
CraftMetaCrossbow.CHARGED_PROJECTILES.NBT, CraftMetaCrossbow.CHARGED_PROJECTILES.NBT,
CraftMetaSuspiciousStew.EFFECTS.NBT, CraftMetaSuspiciousStew.EFFECTS.NBT,
@ -275,10 +275,10 @@ index 45f4f8265c51a5b08db8aa7f53915c4bd0536d39..4ad6fd7e110f949f0bd859331ed6a510
CraftMetaCompass.LODESTONE_POS.NBT, CraftMetaCompass.LODESTONE_POS.NBT,
CraftMetaCompass.LODESTONE_TRACKED.NBT, CraftMetaCompass.LODESTONE_TRACKED.NBT,
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index c1fc48881dffa61f461078bea5640f8c1a1f6570..b0bb30aebdba99a8fa929ec3c56e46b59d2467c9 100644 index a7505a08b952431d1dd7e4b332ede0c0d15eea64..f3a0578f53863dd0866b4c2cb957a30fa3bc6cc5 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -314,6 +314,7 @@ public class ItemMetaTest extends AbstractTestingBase { @@ -324,6 +324,7 @@ public class ItemMetaTest extends AbstractTestingBase {
final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta(); final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta();
meta.entityTag = new CompoundTag(); meta.entityTag = new CompoundTag();
meta.entityTag.putBoolean("Small", true); meta.entityTag.putBoolean("Small", true);

View File

@ -21,10 +21,10 @@ index 3577100f850975020b74f077d688f59dbca78962..da4a110809eee691c1d5b072de335d75
private void allChunksAreSlimeChunks() { private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index eb71f050fcd673ee4d9d1da62e098e2e37d4dd9a..278416af649425890ad00ca6f47d459ebab08e0b 100644 index 615ed6c07a3c20f0bd6b58f7d260e12d34b7ab0a..da0176ed9d51aef76d9c439a03718c1635c35333 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1191,6 +1191,7 @@ public abstract class Player extends LivingEntity { @@ -1187,6 +1187,7 @@ public abstract class Player extends LivingEntity {
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;

View File

@ -190,7 +190,7 @@ index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4
public ClientboundStatusResponsePacket(ServerStatus metadata) { public ClientboundStatusResponsePacket(ServerStatus metadata) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 151d08104ed390905becda5f7ba16c8f933cd3d0..80f8e994d4a85f5d240854ec492adba0633263b2 100644 index 34e801e225173246ba6f4c2ab68ef3f5f2278d78..2bbed2eb8f992764deac2cd5e08471aa0f967606 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server; @@ -2,6 +2,9 @@ package net.minecraft.server;
@ -203,7 +203,7 @@ index 151d08104ed390905becda5f7ba16c8f933cd3d0..80f8e994d4a85f5d240854ec492adba0
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1311,7 +1314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1313,7 +1316,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
this.lastServerStatus = i; this.lastServerStatus = i;
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount())); this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));

View File

@ -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 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/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1d767cf3f63569ce97132c5d0d6043584b54c658..38c7a8befad8633243b55d0f692f49f2e1b61256 100644 index c9bc580b1fb274ea2af31adab0440132e3775ba6..096caeab9813d59e4b086c379e100d8b22713194 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1514,6 +1514,25 @@ public final class CraftServer implements Server { @@ -1514,6 +1514,25 @@ public final class CraftServer implements Server {
@ -26,7 +26,7 @@ index 1d767cf3f63569ce97132c5d0d6043584b54c658..38c7a8befad8633243b55d0f692f49f2
+ GameProfile profile; + GameProfile profile;
+ // Only fetch an online UUID in online mode + // Only fetch an online UUID in online mode
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) { + if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) {
+ profile = console.getProfileCache().get( name ); + profile = console.getProfileCache().get(name).orElse(null);
+ } else { + } else {
+ // Make an OfflinePlayer using an offline mode UUID since the name has no profile + // Make an OfflinePlayer using an offline mode UUID since the name has no profile
+ profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name); + profile = new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add method to open already placed sign
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index bddfc12e8cf896bee5fb518ddacdca434456c6bb..c839ea0b68fbdccfb7ed667c705a3f0f347fd89c 100644 index 54947f02f29dd3dc546ee0d0f4600630242f003d..f1b1d1881d0598503a7ec1022ef5e00f848fb247 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -610,6 +610,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -610,6 +610,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -25,4 +25,4 @@ index bddfc12e8cf896bee5fb518ddacdca434456c6bb..c839ea0b68fbdccfb7ed667c705a3f0f
+ // Paper end + // Paper end
@Override @Override
public boolean dropItem(boolean dropAll) { public boolean dropItem(boolean dropAll) {
return this.getHandle().drop(dropAll); if (!(this.getHandle() instanceof ServerPlayer)) return false;

View File

@ -20,10 +20,10 @@ index da4a110809eee691c1d5b072de335d75e1516eae..9225372cb9ef51a8cfbd4cee543c250a
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 91f96f5718f7a7f2e0ce56f4dbf894d8a052630c..8932cb934d77c0c120cad8392acbbc1c049dcfa7 100644 index f9593486e5382c629e0febd43b3d7464481f0045..28b1d0291d5ffce2606b42394ea22de7a382f9fd 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1240,7 +1240,11 @@ public abstract class Player extends LivingEntity { @@ -1236,7 +1236,11 @@ public abstract class Player extends LivingEntity {
} }
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e12f0af47108b09e490f2a1e51a98accfcc6bd28..f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f 100644 index 8c2242d7e443bee26741608c65d314d8902f5765..4cbdf64b0e6271a1cf0f31d486d8fad4f941b913 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2787,9 +2787,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2775,9 +2775,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
if (this.player.isTextFilteringEnabled()) { if (this.player.isTextFilteringEnabled()) {

View File

@ -19,10 +19,10 @@ index a0a846a2e60bdc17537bd697137f65321c1a61d8..e1110274a9f6b8f7007537732ec8eff7
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0dc03f53c80aac91a914bea91958a6c11c4f2061..08c29388621bf460e1704f6edba59d08a12e75d0 100644 index 4da63e5c35b1736f2d55713b39b64cc31ecbc9c9..848a000d7a959e161011b21012e5d9c438b55455 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3665,12 +3665,24 @@ public abstract class LivingEntity extends Entity { @@ -3668,12 +3668,24 @@ public abstract class LivingEntity extends Entity {
if (this.isUsingItem() && !this.useItem.isEmpty()) { if (this.isUsingItem() && !this.useItem.isEmpty()) {
Item item = this.useItem.getItem(); Item item = this.useItem.getItem();

View File

@ -7,10 +7,10 @@ Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used. Plugins can skip selection of certain arrows and control which is used.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 8932cb934d77c0c120cad8392acbbc1c049dcfa7..543a1c9bc5aa97262424758c69cb28127fa0ee75 100644 index 28b1d0291d5ffce2606b42394ea22de7a382f9fd..ce8b5394f418583608bb8965c058660264ddf66c 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2186,6 +2186,17 @@ public abstract class Player extends LivingEntity { @@ -2182,6 +2182,17 @@ public abstract class Player extends LivingEntity {
return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING); return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING);
} }
@ -28,7 +28,7 @@ index 8932cb934d77c0c120cad8392acbbc1c049dcfa7..543a1c9bc5aa97262424758c69cb2812
@Override @Override
public ItemStack getProjectile(ItemStack stack) { public ItemStack getProjectile(ItemStack stack) {
if (!(stack.getItem() instanceof ProjectileWeaponItem)) { if (!(stack.getItem() instanceof ProjectileWeaponItem)) {
@@ -2202,7 +2213,7 @@ public abstract class Player extends LivingEntity { @@ -2198,7 +2209,7 @@ public abstract class Player extends LivingEntity {
for (int i = 0; i < this.inventory.getContainerSize(); ++i) { for (int i = 0; i < this.inventory.getContainerSize(); ++i) {
ItemStack itemstack2 = this.inventory.getItem(i); ItemStack itemstack2 = this.inventory.getItem(i);

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent
This event is called when an entity receives knockback by another entity. This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4b3361397 100644 index 848a000d7a959e161011b21012e5d9c438b55455..ab34cf7d603ba0fd8624db821b2c0e9e22286c63 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1437,7 +1437,7 @@ public abstract class LivingEntity extends Entity { @@ -1437,7 +1437,7 @@ public abstract class LivingEntity extends Entity {
@ -27,7 +27,7 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4
} }
private boolean checkTotemDeathProtection(DamageSource source) { private boolean checkTotemDeathProtection(DamageSource source) {
@@ -1733,6 +1733,11 @@ public abstract class LivingEntity extends Entity { @@ -1737,6 +1737,11 @@ public abstract class LivingEntity extends Entity {
} }
public void knockback(double strength, double x, double z) { public void knockback(double strength, double x, double z) {
@ -39,7 +39,7 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4
strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE);
if (strength > 0.0D) { if (strength > 0.0D) {
this.hasImpulse = true; this.hasImpulse = true;
@@ -1740,6 +1745,15 @@ public abstract class LivingEntity extends Entity { @@ -1744,6 +1749,15 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength); Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z);
@ -56,10 +56,10 @@ index 08c29388621bf460e1704f6edba59d08a12e75d0..7bb2ce6b378547d593f8487626b5a4d4
} }
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 85633cd1718783cffe03f750da1c17270eeb4cdd..5595150b0da580fce4d5d23993d77314e225ad58 100644 index 6b18d4dd869b442f06a7e9ae690edd5ff5227cbb..e9e89608c4b77868fed92717c837db76d6bb5a54 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1532,7 +1532,7 @@ public abstract class Mob extends LivingEntity { @@ -1533,7 +1533,7 @@ public abstract class Mob extends LivingEntity {
if (flag) { if (flag) {
if (f1 > 0.0F && target instanceof LivingEntity) { if (f1 > 0.0F && target instanceof LivingEntity) {
@ -69,10 +69,10 @@ index 85633cd1718783cffe03f750da1c17270eeb4cdd..5595150b0da580fce4d5d23993d77314
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 543a1c9bc5aa97262424758c69cb28127fa0ee75..022bff6ac8ed5f2da438929c5ac455505bb16da7 100644 index ce8b5394f418583608bb8965c058660264ddf66c..3db5b3adb9fe4a1682b0a4e75ae3e1f6febb7822 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1234,7 +1234,7 @@ public abstract class Player extends LivingEntity { @@ -1230,7 +1230,7 @@ public abstract class Player extends LivingEntity {
if (flag5) { if (flag5) {
if (i > 0) { if (i > 0) {
if (target instanceof LivingEntity) { if (target instanceof LivingEntity) {
@ -81,7 +81,7 @@ index 543a1c9bc5aa97262424758c69cb28127fa0ee75..022bff6ac8ed5f2da438929c5ac45550
} else { } else {
target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F)); target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F));
} }
@@ -1258,7 +1258,7 @@ public abstract class Player extends LivingEntity { @@ -1254,7 +1254,7 @@ public abstract class Player extends LivingEntity {
if (entityliving != this && entityliving != target && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { if (entityliving != this && entityliving != target && !this.isAlliedTo(entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
// CraftBukkit start - Only apply knockback if the damage hits // CraftBukkit start - Only apply knockback if the damage hits
if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) { if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) {

View File

@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not. to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9fb3998a9fc8ce6ffd50e800dccc331df5ab86df..4d816f0b2225677b31f39730ac13dcea28f55520 100644 index 673af9a823d7b16c6dd37a3db700aba676fb5585..eaaf2887bfeccb18fc2b011ba39180ee6b7838a5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1055,7 +1055,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -1055,7 +1055,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@ -29,10 +29,10 @@ index 9fb3998a9fc8ce6ffd50e800dccc331df5ab86df..4d816f0b2225677b31f39730ac13dcea
} }
// Spigot End // Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7bb6a359c2 100644 index fb42d7e3a1a23c02e8fd2cc04e6986ead581018c..2c32d7c37d7d9b9c12c5af3a9af576ac88618049 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -602,7 +602,7 @@ public class ServerPlayer extends Player { @@ -598,7 +598,7 @@ public class ServerPlayer extends Player {
} }
// Paper end // Paper end
if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) { if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) {
@ -41,7 +41,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b
this.containerMenu = this.inventoryMenu; this.containerMenu = this.inventoryMenu;
} }
@@ -754,7 +754,7 @@ public class ServerPlayer extends Player { @@ -750,7 +750,7 @@ public class ServerPlayer extends Player {
// SPIGOT-943 - only call if they have an inventory open // SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) { if (this.containerMenu != this.inventoryMenu) {
@ -50,7 +50,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b
} }
net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure
@@ -1341,7 +1341,7 @@ public class ServerPlayer extends Player { @@ -1337,7 +1337,7 @@ public class ServerPlayer extends Player {
return OptionalInt.empty(); return OptionalInt.empty();
} else { } else {
if (this.containerMenu != this.inventoryMenu) { if (this.containerMenu != this.inventoryMenu) {
@ -59,7 +59,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b
} }
this.nextContainerCounter(); this.nextContainerCounter();
@@ -1401,7 +1401,7 @@ public class ServerPlayer extends Player { @@ -1397,7 +1397,7 @@ public class ServerPlayer extends Player {
} }
// CraftBukkit end // CraftBukkit end
if (this.containerMenu != this.inventoryMenu) { if (this.containerMenu != this.inventoryMenu) {
@ -68,7 +68,7 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b
} }
// this.nextContainerCounter(); // CraftBukkit - moved up // this.nextContainerCounter(); // CraftBukkit - moved up
@@ -1430,7 +1430,13 @@ public class ServerPlayer extends Player { @@ -1426,7 +1426,13 @@ public class ServerPlayer extends Player {
@Override @Override
public void closeContainer() { public void closeContainer() {
@ -84,10 +84,10 @@ index 73fa8277ab107ef0ec690d81caac0e98535a3110..47f1a0e409f42e6694f143ce340eda7b
this.doCloseContainer(); this.doCloseContainer();
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc506bc2b3d7 100644 index 4cbdf64b0e6271a1cf0f31d486d8fad4f941b913..897a950a5a0b669aff05387efb9c403764a0e8ea 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -188,6 +188,7 @@ import org.bukkit.event.inventory.ClickType; @@ -187,6 +187,7 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
@ -95,7 +95,7 @@ index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc50
import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent; import org.bukkit.event.inventory.SmithItemEvent;
@@ -2333,10 +2334,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2320,10 +2321,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleContainerClose(ServerboundContainerClosePacket packet) { public void handleContainerClose(ServerboundContainerClosePacket packet) {
@ -114,10 +114,10 @@ index f3f0229c4fbbc1c54d3472b3ee6357ff1f542a1f..f07dcd1b01780b2980e021a008e8fc50
this.player.doCloseContainer(); this.player.doCloseContainer();
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f..a68e342112002782560268350b88f617b9bf86e1 100644 index 1ae11a88b2ab49c13155e2cf41252c8716f30b96..8be7cf4533792315965c4e227b0ef73d06c0577a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -500,7 +500,7 @@ public abstract class PlayerList { @@ -502,7 +502,7 @@ public abstract class PlayerList {
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
// See SPIGOT-5799, SPIGOT-6145 // See SPIGOT-5799, SPIGOT-6145
if (entityplayer.containerMenu != entityplayer.inventoryMenu) { if (entityplayer.containerMenu != entityplayer.inventoryMenu) {
@ -127,7 +127,7 @@ index 9f27c6fa106a11ea56a4be2d41f8a00f2aa4961f..a68e342112002782560268350b88f617
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 022bff6ac8ed5f2da438929c5ac455505bb16da7..1a7bd2462bab95fa6986cef705e5e5b82da30063 100644 index 3db5b3adb9fe4a1682b0a4e75ae3e1f6febb7822..5dc5c12f341282f296082ce9c972808b8f155b1d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -264,7 +264,7 @@ public abstract class Player extends LivingEntity { @@ -264,7 +264,7 @@ public abstract class Player extends LivingEntity {
@ -154,7 +154,7 @@ index 022bff6ac8ed5f2da438929c5ac455505bb16da7..1a7bd2462bab95fa6986cef705e5e5b8
this.containerMenu = this.inventoryMenu; this.containerMenu = this.inventoryMenu;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index c839ea0b68fbdccfb7ed667c705a3f0f347fd89c..43cee8b0b2b94d6db6303a1631731ed515eb806d 100644 index f1b1d1881d0598503a7ec1022ef5e00f848fb247..a9f8ffa1772de39c74394f8cf324ab77ff4e0450 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -373,7 +373,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -373,7 +373,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -185,7 +185,7 @@ index c839ea0b68fbdccfb7ed667c705a3f0f347fd89c..43cee8b0b2b94d6db6303a1631731ed5
@Override @Override
public boolean isBlocking() { public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 60b8d4f974952c131c94c0dd23e44e28135beff9..1800119160d5711b694c14e9dde175b11c06ce61 100644 index c674ff33ebbb7e214205b3521d414a0442a46cbb..295f82fcdc42103e99bb5c0ab472388f83ac5646 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -921,7 +921,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -921,7 +921,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -198,7 +198,7 @@ index 60b8d4f974952c131c94c0dd23e44e28135beff9..1800119160d5711b694c14e9dde175b1
// Check if the fromWorld and toWorld are the same. // Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index deb331a95d1c8e53c21e2ab68f205c2427cdbef4..378e09eca16738bce048837752149f212a6e2cc3 100644 index aa1487318dd8c3287c32817e71920cc2ac931cdf..e9a7c4a29491b4281f7c96c002bf405b10eb97a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1170,7 +1170,7 @@ public class CraftEventFactory { @@ -1170,7 +1170,7 @@ public class CraftEventFactory {

View File

@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem. cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 832233eea019b9a10b182ef1a2a072ece4b88ee4..f8787bda0652affef90300e334200c34db6b1675 100644 index 897a950a5a0b669aff05387efb9c403764a0e8ea..857fa3a4f2d5afd27df7ce943359705b3ea131d3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2218,6 +2218,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2205,6 +2205,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} }
if (event.isCancelled()) { if (event.isCancelled()) {

View File

@ -31,10 +31,10 @@ index 6d717d3852afb3a3a4bef30c68980c402bdfefff..b47b1215e685c453c3496439bb350a91
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 45a9c7d5b8999d1abd7f5ef805f068f5b532dcfa..00e6ad6ce3bc8e4542284f426fd601abb669b57d 100644 index e83ad85f2350da4a01fd0c848a821d556c7ea9b2..a84c8e135511eed9db5895bdf7fc68b3952a5521 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -767,6 +767,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -772,6 +772,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end // Paper end
} }
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index c25cb17ef1a7c56e10ce3ccb5665c9dce3e6efa6..30118ff975da9491fa41db2133d217c2a797a8e3 100644 index b09f52330b50879d5594b21302e70ca676b60951..d7d4aa7ed2f321df8099adb97a3c699ed38ae6fc 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -209,7 +209,14 @@ public abstract class Projectile extends Entity { @@ -209,7 +209,14 @@ public abstract class Projectile extends Entity {
@ -38,7 +38,7 @@ index 86d245c9a817be5fd2be7f331d3a3a5f3169e8c2..44b28773fe8e79931e738d493bd9405e
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn); BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8b18b04e0 100644 index a84c8e135511eed9db5895bdf7fc68b3952a5521..1fef077a6d5efc8bdc171b5c6e2a49129f8589ce 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -71,6 +71,10 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData; @@ -71,6 +71,10 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
@ -52,7 +52,7 @@ index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8
import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Scoreboard;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@@ -248,6 +252,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -249,6 +253,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
} }
@ -99,7 +99,7 @@ index 2d13cbfb5e4ea359106fc008f203b104a179b9c0..f820232e037fa05f7d666fddac6ad1b8
public boolean isClientSide() { public boolean isClientSide() {
return this.isClientSide; return this.isClientSide;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 378e09eca16738bce048837752149f212a6e2cc3..4e5128629ccbb884d88b369be5010e6b20763707 100644 index e9a7c4a29491b4281f7c96c002bf405b10eb97a2..5d2e1c12feac542463edc7b0e44501c241812310 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1206,6 +1206,14 @@ public class CraftEventFactory { @@ -1206,6 +1206,14 @@ public class CraftEventFactory {

View File

@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 982da5f98601c6b3095d78e69e02554640708c64..fa6819fe0eaf52a1f7182ffb775e0a210530aa9b 100644 index efdcccac85626835ff29ed00976978d5bb900356..b3acc23d54c593b599517a481ad6ac86e5661fa2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -571,7 +571,7 @@ public final class CraftItemStack extends ItemStack { @@ -574,7 +574,7 @@ public final class CraftItemStack extends ItemStack {
@Override @Override
public boolean hasItemMeta() { public boolean hasItemMeta() {
@ -24,10 +24,10 @@ index 982da5f98601c6b3095d78e69e02554640708c64..fa6819fe0eaf52a1f7182ffb775e0a21
static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) { static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) {
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index b0bb30aebdba99a8fa929ec3c56e46b59d2467c9..34eba991c838950c16d565ef6c767bd6a6159bdc 100644 index f3a0578f53863dd0866b4c2cb957a30fa3bc6cc5..44bc92bea0fa0742ef861e16eba3e57d9c6e49ce 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -97,6 +97,34 @@ public class ItemMetaTest extends AbstractTestingBase { @@ -99,6 +99,34 @@ public class ItemMetaTest extends AbstractTestingBase {
assertThat(itemMeta.hasConflictingEnchant(null), is(false)); assertThat(itemMeta.hasConflictingEnchant(null), is(false));
} }

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index d1c1cf5061f9294d67086b5361166e940536a8a0..e9b1d967f5e97ec9a85465e8cfbcac98020d5ecc 100644 index eaaf2887bfeccb18fc2b011ba39180ee6b7838a5..9eca5fc914400c1118927cd4424b3eed9f8ed8dc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1413,15 +1413,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @@ -1413,15 +1413,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@ -49,10 +49,10 @@ index fe90b59a71b85afd3f4b5f7c4d4ba66ed74a05df..c9dcbc2dcb2736d0f448496c67121db2
if (event.isCancelled()) { if (event.isCancelled()) {
return InteractionResult.PASS; return InteractionResult.PASS;
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index f6aa7ac23288c67178e22b194f831d337dd4dda0..580f3e8de2e10ddc01430e84fc42e243736c4810 100644 index 454e07a47d35b8dc8e5f1fb38da74669b4f7cdc7..15787afad42f9299638a1c9e57d26678805f18ee 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -166,7 +166,7 @@ public class Goat extends Animal { @@ -180,7 +180,7 @@ public class Goat extends Animal {
if (itemstack.is(Items.BUCKET) && !this.isBaby()) { if (itemstack.is(Items.BUCKET) && !this.isBaby()) {
// CraftBukkit start - Got milk? // CraftBukkit start - Got milk?
@ -117,10 +117,10 @@ index 24272b384b96bb98a8231fe8583f404ad0c96de5..7c3e94c6bf8337ef660473d8ed451606
int i = blockposition.getX(); int i = blockposition.getX();
int j = blockposition.getY(); int j = blockposition.getY();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a74895271378571583e33c8d3992f2eb863b5a40..c9e6dd18193c7dc2ae76f688e6bbf9463a1149c7 100644 index 1fef077a6d5efc8bdc171b5c6e2a49129f8589ce..ac46dac8be79953720fab6485caf677f2c3ad87b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -291,6 +291,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -292,6 +292,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return true; return true;
} }
// Paper end // Paper end
@ -139,7 +139,7 @@ index a74895271378571583e33c8d3992f2eb863b5a40..c9e6dd18193c7dc2ae76f688e6bbf946
public boolean isClientSide() { public boolean isClientSide() {
return this.isClientSide; return this.isClientSide;
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index be667bb12e1ee186b8d9ad1d7ac4534454d0e787..cf6bcbe7d75a52fe509e3b6c6c24b64bf9d460ad 100644 index f208239b69dbd8788b799d8b28e457017edef9d5..4ce706eed9e1a96b6f9be9b8e4c5283d575ab671 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -580,3 +580,4 @@ public final class NaturalSpawner { @@ -580,3 +580,4 @@ public final class NaturalSpawner {
@ -148,7 +148,7 @@ index be667bb12e1ee186b8d9ad1d7ac4534454d0e787..cf6bcbe7d75a52fe509e3b6c6c24b64b
} }
+ +
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4e5128629ccbb884d88b369be5010e6b20763707..8f44cabc1a92dc3e9afe988b23ac982e85d49fc8 100644 index 5d2e1c12feac542463edc7b0e44501c241812310..52597fe89ed9bb42dcd74f8e9a9d80e1644b2dca 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -222,7 +222,7 @@ public class CraftEventFactory { @@ -222,7 +222,7 @@ public class CraftEventFactory {

View File

@ -45,10 +45,10 @@ index 77a03abd59db4a43f6f2d59d4c7ef176e782f205..bd508025b771424c942fd856c31d520b
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f14910970759dd2 100644 index 857fa3a4f2d5afd27df7ce943359705b3ea131d3..265d147de39e306fac27913b2dc3899e82c63796 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -228,6 +228,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -227,6 +227,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private long keepAliveChallenge; private long keepAliveChallenge;
// CraftBukkit start - multithreaded fields // CraftBukkit start - multithreaded fields
private AtomicInteger chatSpamTickCount = new AtomicInteger(); private AtomicInteger chatSpamTickCount = new AtomicInteger();
@ -56,7 +56,7 @@ index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f149109
// CraftBukkit end // CraftBukkit end
private int dropSpamTickCount; private int dropSpamTickCount;
private double firstGoodX; private double firstGoodX;
@@ -360,6 +361,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -359,6 +360,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.server.getProfiler().pop(); this.server.getProfiler().pop();
// CraftBukkit start // CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
@ -64,7 +64,7 @@ index f8787bda0652affef90300e334200c34db6b1675..eb52ca159e895608a6a662821f149109
/* Use thread-safe field access instead /* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) { if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount; --this.chatSpamTickCount;
@@ -706,7 +708,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -705,7 +707,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async
// CraftBukkit start // CraftBukkit start

View File

@ -12,10 +12,10 @@ This allows the client to render multiple skull textures from the same user,
for when different skins were used when skull was made. for when different skins were used when skull was made.
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index e38e53bd39c384bac4d7111e6a2c721744a122f1..70fb9001b12b105fbf471bd0127d8414e03f9329 100644 index b10cf0c5800397520f57c0bbc88a52e52db6a4c8..e3b80334164ba48e83cca0b9a7f3a8ddf05dd598 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -472,9 +472,18 @@ public class FriendlyByteBuf extends ByteBuf { @@ -497,9 +497,18 @@ public class FriendlyByteBuf extends ByteBuf {
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) { if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
// Spigot start - filter // Spigot start - filter
stack = stack.copy(); stack = stack.copy();
@ -35,7 +35,7 @@ index e38e53bd39c384bac4d7111e6a2c721744a122f1..70fb9001b12b105fbf471bd0127d8414
} }
this.writeNbt(nbttagcompound); this.writeNbt(nbttagcompound);
@@ -494,7 +503,16 @@ public class FriendlyByteBuf extends ByteBuf { @@ -519,7 +528,16 @@ public class FriendlyByteBuf extends ByteBuf {
itemstack.setTag(this.readNbt()); itemstack.setTag(this.readNbt());
// CraftBukkit start // CraftBukkit start
if (itemstack.getTag() != null) { if (itemstack.getTag() != null) {
@ -66,18 +66,18 @@ index 3bdb09ab00ec05ed532a0c26b9fd321e1f05c1a0..1451a98d69b185dd15a2d1d7681bcecb
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
index eaf586eb386e13e954bc593f6ddbc45929cec204..172413fc0f303d5e15bc2bc55c09ce4faf5298a0 100644 index 836c52bfc170788553b639e9a8a82f3f21be670b..6381544b0038de9a09c01238638e4e127e4eddc6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -10,6 +10,7 @@ import java.util.function.Consumer; @@ -11,6 +11,7 @@ import javax.annotation.Nullable;
import javax.annotation.Nullable; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.NbtUtils; import net.minecraft.nbt.NbtUtils;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.server.players.GameProfileCache; import net.minecraft.server.players.GameProfileCache;
@@ -91,9 +92,37 @@ public class SkullBlockEntity extends BlockEntity { @@ -95,9 +96,37 @@ public class SkullBlockEntity extends BlockEntity {
@Nullable @Nullable
@Override @Override
public ClientboundBlockEntityDataPacket getUpdatePacket() { public ClientboundBlockEntityDataPacket getUpdatePacket() {

Some files were not shown because too many files have changed in this diff Show More