diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt new file mode 100644 index 0000000..f35428a --- /dev/null +++ b/build-data/dev-imports.txt @@ -0,0 +1,10 @@ +# You can use this file to import files from minecraft libraries into the project +# format: +# +# both fully qualified and a file based syntax are accepted for : +# authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +# datafixerupper com.mojang.datafixers.DataFixerBuilder +# datafixerupper com/mojang/datafixers/util/Either.java +# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: +# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter +# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java \ No newline at end of file diff --git a/build-data/mcdev-imports.txt b/build-data/mcdev-imports.txt deleted file mode 100644 index 6f0ec2f..0000000 --- a/build-data/mcdev-imports.txt +++ /dev/null @@ -1,4 +0,0 @@ -# You can use this file to import files from vanilla into the project -# both fully qualified and a file based syntax are accepted here: -# net.minecraft.world.level.entity.LevelEntityGetterAdapter -# net/minecraft/world/level/entity/LevelEntityGetter.java diff --git a/build.gradle.kts b/build.gradle.kts index f132018..75f8c8a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,8 +3,8 @@ import io.papermc.paperweight.util.constants.* plugins { java `maven-publish` - id("com.github.johnrengelman.shadow") version "8.1.0" apply false - id("io.papermc.paperweight.patcher") version "1.5.3" + id("com.github.johnrengelman.shadow") version "8.1.1" apply false + id("io.papermc.paperweight.patcher") version "1.5.5" } repositories { @@ -17,7 +17,7 @@ repositories { dependencies { remapper("net.fabricmc:tiny-remapper:0.8.6:fat") decompiler("net.minecraftforge:forgeflower:2.0.627.2") - paperclip("io.papermc:paperclip:3.0.2") + paperclip("io.papermc:paperclip:3.0.3") } allprojects { @@ -48,10 +48,6 @@ subprojects { maven("https://papermc.io/repo/repository/maven-public/") maven("https://sonatype.projecteden.gg/repository/maven-public/") } - - dependencies { - implementation("gg.projecteden:eden-interfaces:2.1.0-SNAPSHOT") - } } paperweight { diff --git a/gradle.properties b/gradle.properties index f22f44c..6d172b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,12 @@ group = gg.projecteden.parchment -version = 1.19.4-R0.1-SNAPSHOT +version = 1.20.1-R0.1-SNAPSHOT -mcVersion = 1.19.4 -paperRef = 5c78e77da522c8a12a2720e10c47a071615780b5 +mcVersion = 1.20.1 +paperRef = d6d2b6f4e51b24867b609cf747ac6d8c6345c449 +edenVersion = 2.2.8-SNAPSHOT org.gradle.caching=true org.gradle.parallel=true org.gradle.vfs.watch=false org.gradle.warning.mode=none +org.gradle.jvmargs=-Xmx4G diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927..ccebba7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e1bef7e..37aef8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..79a61d4 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -205,6 +209,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd3..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/patches/api/0001-Build-changes.patch b/patches/api/0001-Build-changes.patch new file mode 100644 index 0000000..06b0fde --- /dev/null +++ b/patches/api/0001-Build-changes.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lexi Larkin +Date: Sun, 6 Aug 2023 22:01:19 -0400 +Subject: [PATCH] Build changes + + +diff --git a/build.gradle.kts b/build.gradle.kts +index 149f9088fe806467656e8b1c4157df60fda69ba7..d9f93515f92e35ad27f20ead90952b5ecee86661 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -19,6 +19,7 @@ val apiAndDocs: Configuration by configurations.creating { + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + } + } ++val edenVersion: String by project // Parchment + configurations.api { + extendsFrom(apiAndDocs) + } +@@ -46,6 +47,7 @@ dependencies { + apiAndDocs("net.kyori:adventure-text-logger-slf4j") + api("org.apache.logging.log4j:log4j-api:$log4jVersion") + api("org.slf4j:slf4j-api:$slf4jVersion") ++ api("gg.projecteden:eden-interfaces:$edenVersion") // Parchment + + implementation("org.ow2.asm:asm:9.4") + implementation("org.ow2.asm:asm-commons:9.4") diff --git a/patches/api/0001-Add-Getter-interfaces.patch b/patches/api/0002-Add-Getter-interfaces.patch similarity index 94% rename from patches/api/0001-Add-Getter-interfaces.patch rename to patches/api/0002-Add-Getter-interfaces.patch index 28a3298..5090c7f 100644 --- a/patches/api/0001-Add-Getter-interfaces.patch +++ b/patches/api/0002-Add-Getter-interfaces.patch @@ -128,7 +128,7 @@ index 9be64a95c2345433b6142d611077dedadcef9f5d..e3cea810881868fb5869de72f331733e @NotNull private final String buffer; private final boolean isCommand; diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java -index 89e132525cfae0ce979e37b3e2793df781e47227..f14635ae3112862c1337398bf5f5f56a7f87d90f 100644 +index 2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a..640a01478be687b089aeddad422e4bba2bea19b6 100644 --- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java @@ -8,7 +8,7 @@ import static com.google.common.base.Preconditions.*; @@ -427,7 +427,7 @@ index 12163a7b0591a7d022dc7eb9ee6608a1b6c39d9b..d81c7307127b135417e06a3b244416be private static final HandlerList handlers = new HandlerList(); private final Player player; diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 6bbf8468bc47e82b0aeb164e49cdb73d93bae87b..1d7077f3a1be8068747aaf0665a1dee797bb4088 100644 +index 1bfe465b9aaeea7d3c871140145b7de1b8f1d93d..babaefd2441b3b3e3b11ac1db6e5dc95eca40f64 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -30,7 +30,7 @@ import org.bukkit.entity.Player; @@ -435,38 +435,36 @@ index 6bbf8468bc47e82b0aeb164e49cdb73d93bae87b..1d7077f3a1be8068747aaf0665a1dee7 * representation by the implementation. */ -public class Location implements Cloneable, ConfigurationSerializable, io.papermc.paper.math.FinePosition { // Paper -+public class Location implements Cloneable, ConfigurationSerializable , io.papermc.paper.math.FinePosition, gg.projecteden.parchment.HasLocation { // Parchment ++public class Location implements Cloneable, ConfigurationSerializable, io.papermc.paper.math.FinePosition, gg.projecteden.parchment.HasLocation { // Paper // Parchment private Reference world; private double x; private double y; -@@ -72,6 +72,13 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm - this.yaw = yaw; +@@ -1200,4 +1200,11 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm + return new Location(world, this.x(), this.y(), this.z(), this.getYaw(), this.getPitch()); } - + // Paper end ++ + // Parchment start + @Override + public @NotNull Location getLocation() { + return this; + } + // Parchment end -+ - /** - * Sets the world that this location resides in - * + } diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index 69b50eee42e8c52063033705bd23a5ef5231ed83..f61ddf47ce33a4a1708e7000bb43b303e3b1a503 100644 +index 9b84cb5abdf3db55cbc7ba19c8cd6955bf4fc5ec..c1410e5d4ec281f6712ab695e57b84757ca0ec82 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -10,7 +10,7 @@ import org.bukkit.profile.PlayerProfile; - import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; - +@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable; + * player that is stored on the disk and can, thus, be retrieved without the + * player needing to be online. + */ -public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable { +public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment /** * Checks if this player is currently online -@@ -139,6 +139,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -190,6 +190,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio @Nullable public Player getPlayer(); @@ -520,7 +518,7 @@ index d124768378d6f0c5573f28ee815ea3886fe74868..11a00998b1cb5ee582e225553f15b1b7 private final UUID uuid; private final String name; diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 390a2a2611df35a9ea6f1eb996b47e2aa4597ff0..e7dcaf75283dd222891e4f20971716934291a672 100644 +index 1c3f54382d66549dc881d4577c7104be6673a274..da7ac29bf25c38d8bdcccdf15122983b6f9b07eb 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable; @@ -528,7 +526,7 @@ index 390a2a2611df35a9ea6f1eb996b47e2aa4597ff0..e7dcaf75283dd222891e4f2097171693 * generation when used in cases like BlockPhysicsEvent!!!! */ -public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable -+public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable ++public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable // Parchment /** * Gets the metadata for this block @@ -572,10 +570,10 @@ index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..8f4a293c131cb8b63c31b410ffa211bd /** * This is the name of the specified AnimalTamer. diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 8c58018b155c52a7b2a139f784abceb6aa00a268..dfa0366e3f46ef974f9d3397f057a6abc5c0e08c 100644 +index 6b842453589cf148ab32c1507cf374056826316e..0bd098a93d6fd3b41d736861c9c0f65f23f4fc62 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable; +@@ -28,7 +28,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents a base entity in the world */ @@ -585,7 +583,7 @@ index 8c58018b155c52a7b2a139f784abceb6aa00a268..dfa0366e3f46ef974f9d3397f057a6ab /** * Gets the entity's current position diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index f17ef44bc02e97ff084e5abfde8d6c6822f00d62..aae9eaa7a0e42cd9bc0a4ccf56bf056441d47c90 100644 +index 8b0d04d5b39ee817555a36adddc39b18fc6f0d02..1c87047de615a85ee20297295478770e669d87e6 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -20,7 +20,15 @@ import org.jetbrains.annotations.Nullable; @@ -593,28 +591,28 @@ index f17ef44bc02e97ff084e5abfde8d6c6822f00d62..aae9eaa7a0e42cd9bc0a4ccf56bf0564 * Represents a human entity, such as an NPC or a player */ -public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder { -+// Parchment start -+public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity { ++public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity { // Parchment + ++ // Parchment start + @NotNull + @Override + default HumanEntity getPlayer() { + return this; + } -+// Parchment end ++ // Parchment end // Paper start @Override diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5f11b2e9c1bca121ae72dd0ec94ae4a86f80a324..f2f32e578fb7748d41d26ae980d4132fdd28f2cd 100644 +index 14c92390aeaeee518f43778ccd5fc820fdc62689..aa99410a0bee71e68da90b596134632f3a6364fe 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -39,7 +39,17 @@ import org.jetbrains.annotations.Nullable; +@@ -51,7 +51,17 @@ import org.jetbrains.annotations.Nullable; /** * Represents a player, connected or not */ --public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, com.destroystokyo.paper.network.NetworkClient { // Paper -+public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, com.destroystokyo.paper.network.NetworkClient, gg.projecteden.parchment.HasPlayer { // Paper // Parchment +-public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient { // Paper ++public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient, gg.projecteden.parchment.HasPlayer { // Paper // Parchment + + // Parchment start - fix defaults + /** @@ -707,7 +705,7 @@ index 6dcd9f828c6c40e48593b0bad5a44a656eb01645..0651bdd983e90e0e1e8a3565dcb5d97c private final IgniteCause cause; private final Entity ignitingEntity; diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java -index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93ea9c51ec 100644 +index 4e3c406ba883aae553e8d69b6b719b872cd6096c..d0a92dc9eba0f61b596e9a388f3aa4076ef2bc65 100644 --- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull; @@ -720,10 +718,10 @@ index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93 protected boolean cancel; protected boolean canBuild; diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java -index c40536f781393cb39e6a1a4ba6e780713d5dc126..e4455679b37ac38bd505982ef12d323c9ff466c3 100644 +index d944d67f544494355f03c5bc9afd8ea7726e6412..800db8e63bdb8c05ffdc88c3a3b0f1f268a1357e 100644 --- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java +++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java -@@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable; +@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; *

* If a Sign Change event is cancelled, the sign will not be changed. */ @@ -788,7 +786,7 @@ index 099efafa14c10910e4ed04abb1823f0c1a96b6a6..382602ca4a9a33cf238f982f77865053 private boolean cancel; private final Location location; diff --git a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java -index 327876e0ad7dcfeb71d9d22afe1c04bcd71c3bf9..466a54c4e30a7886e7383f43f9b6c389a5bdba7c 100644 +index 71d664dd89995f088c47d17b38547d530319470c..d931ece8f35c8f01748c59d01617fd59b287030e 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java @@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable; @@ -879,12 +877,12 @@ index 020739697a0b535cad0b15b574f77cdabbdfa3eb..ee4fd41e66852d5d2c62222c7b884473 private final Material itemType; private final int itemAmount; diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -index 21ad8888c0e403bfc63518502577d651c02dda05..1c59335a8f0a40162190f6fb73ffbfef0cd795d8 100644 +index 4db0a07db156c61867644f50c185e63b695e2462..eb6632e2e9d247bd54e02e3a134dfdbed9aeef39 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; - /** - * Represents a player related inventory event +@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull; + * on the next tick. Also be aware that this is not an exhaustive list, and + * other methods could potentially create issues as well. */ -public class InventoryCloseEvent extends InventoryEvent { +public class InventoryCloseEvent extends InventoryEvent implements gg.projecteden.parchment.HasHumanEntity { // Parchment @@ -892,12 +890,12 @@ index 21ad8888c0e403bfc63518502577d651c02dda05..1c59335a8f0a40162190f6fb73ffbfef // Paper start private final Reason reason; diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java -index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f748278a7 100644 +index ceae092eb782698803c6c3df41267dde20ba62b2..23e35e7e65bdf2e758dc8dc980b9427b7e4163a9 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; /** - * Represents a player related inventory event + * Called when a player opens an inventory */ -public class InventoryOpenEvent extends InventoryEvent implements Cancellable { +public class InventoryOpenEvent extends InventoryEvent implements Cancellable, gg.projecteden.parchment.HasHumanEntity { // Parchment @@ -905,7 +903,7 @@ index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f private boolean cancelled; diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java -index 635b8787fc235b61c0d5677def034656e4ec4cef..6f15f4adfa552e2f5960464663ee126282086bb1 100644 +index fc2d9e85b65347b90bde3b0b13ccae759e33d466..6b2e64fa9c0f3c0af88797d63557c333edf69a5d 100644 --- a/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; @@ -1010,7 +1008,7 @@ index 7af8d6e51c824cf0592b722b834f1d4986e3cc08..c28d62fc3dc359f9ebcf926094198ee3 private boolean cancelled = false; private final Location location; diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bceac9cfaa4 100644 +index 0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3..469b9cc0c4b77844ba0317af51bd9ad873915967 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; @@ -1023,7 +1021,7 @@ index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bce /** * Returns the size of the inventory diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java -index daca40b63e95ea33178bcb54ad45911da591ca54..e9b5206851db890d7638ce94d793fb909be20307 100644 +index 77a0cd901038405ed0e267f0432f13deccae3ab5..abe9b0d97d24e9e2ef1a61e34249895eb35b800f 100644 --- a/src/main/java/org/bukkit/inventory/InventoryView.java +++ b/src/main/java/org/bukkit/inventory/InventoryView.java @@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable; diff --git a/patches/api/0002-Add-SoundEvent.patch b/patches/api/0003-Add-SoundEvent.patch similarity index 91% rename from patches/api/0002-Add-SoundEvent.patch rename to patches/api/0003-Add-SoundEvent.patch index aa8b4de..80296c7 100644 --- a/patches/api/0002-Add-SoundEvent.patch +++ b/patches/api/0003-Add-SoundEvent.patch @@ -6,12 +6,13 @@ Subject: [PATCH] Add SoundEvent diff --git a/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java b/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c0409febb9d +index 0000000000000000000000000000000000000000..14fa1d766f49eed2907214fc536222bae9167a85 --- /dev/null +++ b/src/main/java/gg/projecteden/parchment/event/sound/SoundEvent.java -@@ -0,0 +1,382 @@ +@@ -0,0 +1,359 @@ +package gg.projecteden.parchment.event.sound; + ++import gg.projecteden.parchment.HasLocation; +import gg.projecteden.parchment.OptionalHumanEntity; +import net.kyori.adventure.sound.Sound; +import org.bukkit.Location; @@ -34,7 +35,7 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + * Called when a sound is sent to a player. + * Cancelling this event will prevent the packet from sending. + */ -+public final class SoundEvent extends Event implements Cancellable, OptionalHumanEntity { ++public final class SoundEvent extends Event implements Cancellable { + private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(SoundEvent.class); + + private static final org.bukkit.event.HandlerList handlers = new org.bukkit.event.HandlerList(); @@ -59,16 +60,14 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + private @NotNull Sound sound; + private @NotNull Emitter emitter; + private boolean cancelled; -+ private long seed; + private @Nullable BiFunction<@NotNull SoundEvent, @NotNull Player, @Nullable Sound> soundOverrideFunction; + private @Nullable BiFunction<@NotNull SoundEvent, @NotNull Player, @Nullable Emitter> emitterOverrideFunction; + -+ public SoundEvent(@Nullable HumanEntity except, @NotNull Sound sound, @NotNull Emitter emitter, long seed, @Nullable Function distanceFunction, @Nullable Function> recipientsFunction) { ++ public SoundEvent(@Nullable HumanEntity except, @NotNull Sound sound, @NotNull Emitter emitter, @Nullable Function distanceFunction, @Nullable Function> recipientsFunction) { + super(true); + this.except = except; + this.sound = Objects.requireNonNull(sound, "sound cannot be null"); + this.emitter = Objects.requireNonNull(emitter, "emitter cannot be null"); -+ this.seed = seed; + this.distanceFunction = Objects.requireNonNullElse(distanceFunction, DEFAULT_DISTANCE_FUNCTION); + this.recipientsFunction = wrapRecipientsFunction(Objects.requireNonNullElse(recipientsFunction, DEFAULT_RECIPIENTS_FUNCTION)); + } @@ -77,18 +76,6 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + * Gets the player that won't be receiving this sound. + * + * @return player excluded from receiving this sound -+ * @deprecated use {@link #getException()} for more clarity -+ */ -+ @Override -+ @Deprecated -+ public @Nullable HumanEntity getPlayer() { -+ return getException(); -+ } -+ -+ /** -+ * Gets the player that won't be receiving this sound. -+ * -+ * @return player excluded from receiving this sound + */ + public @Nullable HumanEntity getException() { + return except; @@ -140,24 +127,6 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + } + + /** -+ * Gets the seed used to generate the sound. -+ * -+ * @return seed used to generate the sound -+ */ -+ public long getSeed() { -+ return seed; -+ } -+ -+ /** -+ * Sets the seed used to generate the sound. -+ * -+ * @param seed seed used to generate the sound -+ */ -+ public void setSeed(long seed) { -+ this.seed = seed; -+ } -+ -+ /** + * Calculates the distance of the sound. + *

+ * The distance value is dynamically calculated using a @@ -336,7 +305,7 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + + private record WrappedRecipientsFunction(@NotNull Function> wrapped) implements Function> { + @Override -+ public List apply(SoundEvent event) { ++ public @NotNull List apply(@NotNull SoundEvent event) { + List recipients = wrapped.apply(event); + HumanEntity except = event.getException(); + if (except != null) { @@ -362,14 +331,18 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + /** + * The class which determines where a sound will emit from. + */ -+ public sealed interface Emitter permits EntityEmitter, LocationEmitter { ++ public sealed interface Emitter extends HasLocation permits EntityEmitter, LocationEmitter { + /** + * Gets the location at which the sound will be played. + * + * @return sound's location ++ * @deprecated use {@link #getLocation()} instead + */ + @NotNull -+ Location location(); ++ @Deprecated ++ default Location location() { ++ return getLocation(); ++ } + } + + /** @@ -379,7 +352,7 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + */ + public record EntityEmitter(@NotNull Entity entity) implements Emitter { + @Override -+ public @NotNull Location location() { ++ public @NotNull Location getLocation() { + return entity.getLocation(); + } + } @@ -390,5 +363,9 @@ index 0000000000000000000000000000000000000000..e612cecc89b060a9c0fc882754e45c04 + * @param location the location from which the sound will be played + */ + public record LocationEmitter(@NotNull Location location) implements Emitter { ++ @Override ++ public @NotNull Location getLocation() { ++ return location; ++ } + } +} diff --git a/patches/api/0003-Add-PlayerUseRespawnAnchorEvent.patch b/patches/api/0004-Add-PlayerUseRespawnAnchorEvent.patch similarity index 100% rename from patches/api/0003-Add-PlayerUseRespawnAnchorEvent.patch rename to patches/api/0004-Add-PlayerUseRespawnAnchorEvent.patch diff --git a/patches/api/0004-Add-origin-location-to-EntityDamageByBlockEvent.patch b/patches/api/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch similarity index 59% rename from patches/api/0004-Add-origin-location-to-EntityDamageByBlockEvent.patch rename to patches/api/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch index e9a7635..75eb295 100644 --- a/patches/api/0004-Add-origin-location-to-EntityDamageByBlockEvent.patch +++ b/patches/api/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch @@ -5,39 +5,47 @@ Subject: [PATCH] Add origin location to EntityDamageByBlockEvent diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java -index 461727dc7f06efb3550fc370e0db5bd04ba89711..f20ac2ba1921616f346c11ef60c53aba0080728b 100644 +index ab18f35b686ec79551c307dde9e43c7dfad1b182..47c522e31d704d6c36fbfe128c97cba234932bc7 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java -@@ -12,17 +12,43 @@ import org.jetbrains.annotations.Nullable; - */ +@@ -17,6 +17,7 @@ import org.jetbrains.annotations.Nullable; public class EntityDamageByBlockEvent extends EntityDamageEvent { private final Block damager; + private final org.bukkit.block.BlockState damagerBlockState; // Paper + private final org.bukkit.Location location; // Parchment public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) { + // Paper start +@@ -28,21 +29,41 @@ public class EntityDamageByBlockEvent extends EntityDamageEvent { super(damagee, cause, damage); this.damager = damager; + this.damagerBlockState = damagerBlockState; // Paper + this.location = damager != null ? damager.getLocation() : null; // Parchment } public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map modifiers, @NotNull final Map> modifierFunctions) { - super(damagee, cause, modifiers, modifierFunctions); - this.damager = damager; -+ this.location = damager != null ? damager.getLocation() : null; // Parchment + // Paper start +- this(damager, damagee, cause, modifiers, modifierFunctions, null); ++ this(damager, damagee, cause, modifiers, modifierFunctions, null, null); } -+ // Parchment start -+ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @Nullable final org.bukkit.Location damageLocation, @NotNull final Map modifiers, @NotNull final Map> modifierFunctions) { -+ super(damagee, cause, modifiers, modifierFunctions); -+ this.damager = damager; + @org.jetbrains.annotations.ApiStatus.Internal +- public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map modifiers, @NotNull final Map> modifierFunctions, final @Nullable org.bukkit.block.BlockState damagerBlockState) { ++ public EntityDamageByBlockEvent(@Nullable final Block damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map modifiers, @NotNull final Map> modifierFunctions, final @Nullable org.bukkit.block.BlockState damagerBlockState, @Nullable final org.bukkit.Location damageLocation) { // Parchment + // Paper end + super(damagee, cause, modifiers, modifierFunctions); + this.damager = damager; + this.damagerBlockState = damagerBlockState; // Paper ++ // Parchment start + if (damageLocation != null) + this.location = damageLocation; + else if (damager != null) + this.location = damager.getLocation(); + else + this.location = null; -+ } -+ ++ // Parchment end + } + + /** + * Gets the location of the damage source. + * diff --git a/patches/api/0005-Expanded-Adventure-support.patch b/patches/api/0006-Expanded-Adventure-support.patch similarity index 69% rename from patches/api/0005-Expanded-Adventure-support.patch rename to patches/api/0006-Expanded-Adventure-support.patch index 6b4f155..c009014 100644 --- a/patches/api/0005-Expanded-Adventure-support.patch +++ b/patches/api/0006-Expanded-Adventure-support.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Expanded Adventure support Adds support for Adventure in a few places where it was previously missing. diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java -index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489642245c2 100644 +index 918a045165cdcde264bc24082b7afebb407271de..3f912d3fbf5fdef3b95f81585d2fcf76719d2d04 100644 --- a/src/main/java/org/bukkit/ChatColor.java +++ b/src/main/java/org/bukkit/ChatColor.java -@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; - /** - * All supported color values for chat +@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; + * @deprecated ChatColor has been deprecated in favor of Adventure API. See {@link net.kyori.adventure.text.format.NamedTextColor} for the adventure equivalent of pre-defined text colors */ + @Deprecated // Paper -public enum ChatColor { +public enum ChatColor implements net.kyori.adventure.text.format.StyleBuilderApplicable, net.kyori.adventure.text.format.TextFormat { // Parchment /** * Represents black */ -@@ -181,6 +181,13 @@ public enum ChatColor { +@@ -183,6 +183,13 @@ public enum ChatColor { public net.md_5.bungee.api.ChatColor asBungee() { return net.md_5.bungee.api.ChatColor.MAGIC; } @@ -26,41 +26,13 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489 + // Parchment start + @Override + public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.decorate(net.kyori.adventure.text.format.TextDecoration.OBFUSCATED); ++ style.apply(net.kyori.adventure.text.format.TextDecoration.OBFUSCATED); + } + // Parchment end }, /** * Makes the text bold. -@@ -191,6 +198,13 @@ public enum ChatColor { - public net.md_5.bungee.api.ChatColor asBungee() { - return net.md_5.bungee.api.ChatColor.BOLD; - } -+ -+ // Parchment start -+ @Override -+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.decorate(net.kyori.adventure.text.format.TextDecoration.BOLD); -+ } -+ // Parchment end - }, - /** - * Makes a line appear through the text. -@@ -201,6 +215,13 @@ public enum ChatColor { - public net.md_5.bungee.api.ChatColor asBungee() { - return net.md_5.bungee.api.ChatColor.STRIKETHROUGH; - } -+ -+ // Parchment start -+ @Override -+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.decorate(net.kyori.adventure.text.format.TextDecoration.STRIKETHROUGH); -+ } -+ // Parchment end - }, - /** - * Makes the text appear underlined. -@@ -211,6 +232,13 @@ public enum ChatColor { +@@ -213,6 +220,13 @@ public enum ChatColor { public net.md_5.bungee.api.ChatColor asBungee() { return net.md_5.bungee.api.ChatColor.UNDERLINE; } @@ -68,27 +40,13 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489 + // Parchment start + @Override + public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.decorate(net.kyori.adventure.text.format.TextDecoration.UNDERLINED); ++ style.apply(net.kyori.adventure.text.format.TextDecoration.UNDERLINED); + } + // Parchment end }, /** * Makes the text italic. -@@ -221,6 +249,13 @@ public enum ChatColor { - public net.md_5.bungee.api.ChatColor asBungee() { - return net.md_5.bungee.api.ChatColor.ITALIC; - } -+ -+ // Parchment start -+ @Override -+ public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.decorate(net.kyori.adventure.text.format.TextDecoration.ITALIC); -+ } -+ // Parchment end - }, - /** - * Resets all previous chat colors or formats. -@@ -231,6 +266,16 @@ public enum ChatColor { +@@ -233,6 +247,16 @@ public enum ChatColor { public net.md_5.bungee.api.ChatColor asBungee() { return net.md_5.bungee.api.ChatColor.RESET; } @@ -105,14 +63,17 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489 }; /** -@@ -263,6 +308,13 @@ public enum ChatColor { +@@ -265,6 +289,16 @@ public enum ChatColor { return net.md_5.bungee.api.ChatColor.RESET; }; + // Parchment start + @Override + public void styleApply(net.kyori.adventure.text.format.Style.@NotNull Builder style) { -+ style.color(net.kyori.adventure.text.format.TextColor.color(asBungee().getColor().getRGB())); ++ if (isColor()) ++ style.color(net.kyori.adventure.text.format.TextColor.color(asBungee().getColor().getRGB())); ++ else ++ style.decorate(net.kyori.adventure.text.format.TextDecoration.valueOf(name())); + } + // Parchment end + diff --git a/patches/api/0006-Add-UnsafeValues-canPlaceItemOn.patch b/patches/api/0007-Add-UnsafeValues-canPlaceItemOn.patch similarity index 89% rename from patches/api/0006-Add-UnsafeValues-canPlaceItemOn.patch rename to patches/api/0007-Add-UnsafeValues-canPlaceItemOn.patch index 63381fe..1940769 100644 --- a/patches/api/0006-Add-UnsafeValues-canPlaceItemOn.patch +++ b/patches/api/0007-Add-UnsafeValues-canPlaceItemOn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index b92255a9c87620f46adb140689b1cd328a476d61..3ed52d016314c01293530fa760fa5faaf59586ed 100644 +index c661eab343ae76488de701630424e2d589f44fc0..b0ba8331fa43f4584eac1b1d9f4c3cad9d47b872 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -245,4 +245,17 @@ public interface UnsafeValues { +@@ -250,4 +250,17 @@ public interface UnsafeValues { */ void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey); // Paper end diff --git a/patches/api/0007-Expose-MCUtil-Executors.patch b/patches/api/0008-Expose-MCUtil-Executors.patch similarity index 76% rename from patches/api/0007-Expose-MCUtil-Executors.patch rename to patches/api/0008-Expose-MCUtil-Executors.patch index 05bd572..82122aa 100644 --- a/patches/api/0007-Expose-MCUtil-Executors.patch +++ b/patches/api/0008-Expose-MCUtil-Executors.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Expose MCUtil Executors diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2204336d8800311b65e894739ab1b27273e7c6f2..2c35578c85be5f47c2b2a11f1df16db51e31cc41 100644 +index 68206cf0178c26c0f528a1e14a5fb4e9ad410369..24fa398cc02f803fbb3222082130bf0b7bdd391f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2139,4 +2139,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi - */ - @NotNull org.bukkit.potion.PotionBrewer getPotionBrewer(); - // Paper end -+ +@@ -2053,6 +2053,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + @NotNull + UnsafeValues getUnsafe(); + + // Parchment start + /** + * Gets the executor which runs tasks on an asynchronous thread pool. @@ -28,4 +27,7 @@ index 2204336d8800311b65e894739ab1b27273e7c6f2..2c35578c85be5f47c2b2a11f1df16db5 + @NotNull + java.util.concurrent.Executor getMainExecutor(); + // Parchment end - } ++ + // Spigot start + public class Spigot { + diff --git a/patches/api/0008-Add-BlockDropResourcesEvent.patch b/patches/api/0009-Add-BlockDropResourcesEvent.patch similarity index 100% rename from patches/api/0008-Add-BlockDropResourcesEvent.patch rename to patches/api/0009-Add-BlockDropResourcesEvent.patch diff --git a/patches/api/0009-Add-Furnace-Recipe-API.patch b/patches/api/0010-Add-Furnace-Recipe-API.patch similarity index 82% rename from patches/api/0009-Add-Furnace-Recipe-API.patch rename to patches/api/0010-Add-Furnace-Recipe-API.patch index d48a7d5..4af73dc 100644 --- a/patches/api/0009-Add-Furnace-Recipe-API.patch +++ b/patches/api/0010-Add-Furnace-Recipe-API.patch @@ -9,7 +9,7 @@ Will eventually (hopefully) be replaced by a more extensive Paper PR with suppor diff --git a/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java new file mode 100644 -index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b40459a89d17 +index 0000000000000000000000000000000000000000..ea17d99c7a1d70d88e2c439399cdb376b9dedf47 --- /dev/null +++ b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java @@ -0,0 +1,50 @@ @@ -24,15 +24,15 @@ index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b404 + */ + CRAFTING(false), + /** -+ * Recipes for smelting an item inside of a furnace. ++ * Recipes for smelting an item inside a furnace. + */ + SMELTING(true), + /** -+ * Recipes for smelting an item inside of a blasting furnace. ++ * Recipes for smelting an item inside a blasting furnace. + */ + BLASTING(true), + /** -+ * Recipes for smelting an item inside of a smoker. ++ * Recipes for smelting an item inside a smoker. + */ + SMOKING(true), + /** @@ -64,12 +64,12 @@ index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b404 + } +} diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index aa04d7df70d99402c91e920fd693d7d4fb655786..6bb7341460eab62e83918d3b47fe89302027e9fe 100644 +index 6917931966377c51db88a3364997a110dd987970..9be68828aaecba89444e745e2d4126557c02868d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -4010,6 +4010,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - @Nullable - public DragonBattle getEnderDragonBattle(); +@@ -49,6 +49,36 @@ import org.jetbrains.annotations.Nullable; + */ + public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper + // Parchment start + /** @@ -101,6 +101,6 @@ index aa04d7df70d99402c91e920fd693d7d4fb655786..6bb7341460eab62e83918d3b47fe8930 + ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType); + // Parchment end + + // Paper start /** - * Represents various map environment types that a world may be - */ + * @return The amount of Entities in this world diff --git a/patches/api/0010-Add-HangingFrame-Tick-API.patch b/patches/api/0011-Add-HangingFrame-Tick-API.patch similarity index 100% rename from patches/api/0010-Add-HangingFrame-Tick-API.patch rename to patches/api/0011-Add-HangingFrame-Tick-API.patch diff --git a/patches/api/0011-Add-Player-getHiddenEntities-API.patch b/patches/api/0012-Add-Player-getHiddenEntities-API.patch similarity index 76% rename from patches/api/0011-Add-Player-getHiddenEntities-API.patch rename to patches/api/0012-Add-Player-getHiddenEntities-API.patch index 7a083d8..6ded86e 100644 --- a/patches/api/0011-Add-Player-getHiddenEntities-API.patch +++ b/patches/api/0012-Add-Player-getHiddenEntities-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add Player#getHiddenEntities API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 64734c0ca89859294bde01da3dcaee6dc1840894..205cd1d53bef3a8d18315561543f815ede791570 100644 +index aa99410a0bee71e68da90b596134632f3a6364fe..4390fa4cc4616a13855d38cb5e09d60153368428 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1597,6 +1597,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - @org.jetbrains.annotations.ApiStatus.Experimental // Paper +@@ -1851,6 +1851,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + @ApiStatus.Experimental public boolean canSee(@NotNull Entity entity); + // Parchment start @@ -19,7 +19,7 @@ index 64734c0ca89859294bde01da3dcaee6dc1840894..205cd1d53bef3a8d18315561543f815e + * @param plugin Plugin that has hidden entities + * @return a view of hidden entity UUIDs + */ -+ @org.jetbrains.annotations.ApiStatus.Experimental ++ @ApiStatus.Experimental + public java.util.@NotNull Set getHiddenEntities(@NotNull Plugin plugin); + // Parchment end + diff --git a/patches/api/0012-Add-Timings-Events.patch b/patches/api/0013-Add-Timings-Events.patch similarity index 55% rename from patches/api/0012-Add-Timings-Events.patch rename to patches/api/0013-Add-Timings-Events.patch index d8aa2cc..b7180dd 100644 --- a/patches/api/0012-Add-Timings-Events.patch +++ b/patches/api/0013-Add-Timings-Events.patch @@ -5,128 +5,100 @@ Subject: [PATCH] Add Timings Events diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java -index 852f5673fb3f9c7d7ad44b01d04b3dcdf7352e50..52dc9dd0e45c6b20b2414bd74726ade049959e72 100644 +index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..16198861748b29c537527151216e79c7c32e7204 100644 --- a/src/main/java/co/aikar/timings/Timings.java +++ b/src/main/java/co/aikar/timings/Timings.java -@@ -23,6 +23,8 @@ - */ - package co.aikar.timings; - -+import co.aikar.timings.event.TimingsModifyEvent; -+import co.aikar.timings.event.TimingsModifyEvent.Action; - import com.google.common.base.Preconditions; - import com.google.common.collect.EvictingQueue; - import com.google.common.collect.Lists; -@@ -139,7 +141,24 @@ public final class Timings { +@@ -145,8 +145,27 @@ public final class Timings { * @param enabled Should timings be reported */ public static void setTimingsEnabled(boolean enabled) { ++ // Parchment start + setTimingsEnabled(enabled, null); + } + + /** + *

Sets whether or not the Spigot Timings system should be enabled

+ * -+ * Calls a {@link TimingsModifyEvent}, if cancelled the timings will not be reset ++ * Calls a {@link co.aikar.timings.event.TimingsModifyEvent}, if cancelled the timings will not be reset + * + * @param enabled Should timings be reported + * @param sender The sender asking to reset + */ + public static void setTimingsEnabled(boolean enabled, CommandSender sender) { timingsEnabled = enabled; + warnAboutDeprecationOnEnable(); + if (sender != null) { -+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, Action.RESET).callEvent()) { ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) { + return; + } + } ++ // Parchment end reset(); } diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java -index 61cfad5cd53980836e1fd6ecf08a760166fff2b9..b668b91f2159cd693e95a1652ca0c65012aa7a88 100644 +index e801e79fa57c44b2e5d359647c920f88064826f1..012d2281c386d2e5f5a655079c0cbfa4545d6476 100644 --- a/src/main/java/co/aikar/timings/TimingsCommand.java +++ b/src/main/java/co/aikar/timings/TimingsCommand.java -@@ -60,12 +60,14 @@ public class TimingsCommand extends BukkitCommand { +@@ -63,10 +63,12 @@ public class TimingsCommand extends BukkitCommand { } final String arg = args[0]; if ("on".equalsIgnoreCase(arg)) { - Timings.setTimingsEnabled(true); -- sender.sendMessage(text("Enabled Timings & Reset")); -+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.ENABLE).callEvent()) { -+ Timings.setTimingsEnabled(true, sender); -+ } ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.ENABLE).callEvent()) return true; // Parchment ++ Timings.setTimingsEnabled(true, sender); + sender.sendMessage(text("Enabled Timings & Reset")); return true; } else if ("off".equalsIgnoreCase(arg)) { -- Timings.setTimingsEnabled(false); -- sender.sendMessage(text("Disabled Timings")); -+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.DISABLE).callEvent()) { -+ Timings.setTimingsEnabled(false, sender); -+ } ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.DISABLE).callEvent()) return true; // Parchment + Timings.setTimingsEnabled(false); + sender.sendMessage(text("Disabled Timings")); return true; - } - -@@ -76,20 +78,22 @@ public class TimingsCommand extends BukkitCommand { +@@ -79,15 +81,18 @@ public class TimingsCommand extends BukkitCommand { long now = System.currentTimeMillis(); if ("verbon".equalsIgnoreCase(arg)) { -- Timings.setVerboseTimingsEnabled(true); -- sender.sendMessage(text("Enabled Verbose Timings")); -+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_ON).callEvent()) { -+ Timings.setVerboseTimingsEnabled(true); -+ } ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_ON).callEvent()) return true; // Parchment + Timings.setVerboseTimingsEnabled(true); + sender.sendMessage(text("Enabled Verbose Timings")); return true; } else if ("verboff".equalsIgnoreCase(arg)) { -- Timings.setVerboseTimingsEnabled(false); -- sender.sendMessage(text("Disabled Verbose Timings")); -+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_OFF).callEvent()) { -+ Timings.setVerboseTimingsEnabled(false); -+ } ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.VERBOSE_OFF).callEvent()) return true; // Parchment + Timings.setVerboseTimingsEnabled(false); + sender.sendMessage(text("Disabled Verbose Timings")); return true; } else if ("reset".equalsIgnoreCase(arg)) { if (now - lastResetAttempt < 30000) { -- TimingsManager.reset(); -- sender.sendMessage(text("Timings reset. Please wait 5-10 minutes before using /timings report.", NamedTextColor.RED)); -+ if (new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) { -+ TimingsManager.reset(); -+ } ++ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, co.aikar.timings.event.TimingsModifyEvent.Action.RESET).callEvent()) return true; // Parchment + TimingsManager.reset(); + sender.sendMessage(text("Timings reset. Please wait 5-10 minutes before using /timings report.", NamedTextColor.RED)); } else { - lastResetAttempt = now; -- sender.sendMessage(text("WARNING: Timings v2 should not be reset. If you are experiencing lag, please wait 3 minutes and then issue a report. The best timings will include 10+ minutes, with data before and after your lag period. If you really want to reset, run this command again within 30 seconds.", NamedTextColor.RED)); - } - } else if ( - "paste".equalsIgnoreCase(arg) || diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java -index 3af5b8ea795311582044c712de50d29412024b77..b509aa8d2b05e913277713308e2eea46e631a5df 100644 +index 3af5b8ea795311582044c712de50d29412024b77..806a1e528aae9a26413b483855130bef78ca72fb 100644 --- a/src/main/java/co/aikar/timings/TimingsReportListener.java +++ b/src/main/java/co/aikar/timings/TimingsReportListener.java -@@ -59,7 +59,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa +@@ -59,6 +59,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa @Override public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) { -- net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type); -+ if (new co.aikar.timings.event.TimingsMessageEvent(this.senders, message).callEvent()) { -+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type); -+ } ++ if (!new co.aikar.timings.event.TimingsMessageEvent(this.senders, message).callEvent()) return; // Parchment + net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type); } - @NotNull -@@ -70,7 +72,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa +@@ -70,6 +71,7 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa @Override public void sendMessage(@NotNull String message) { -- senders.forEach((sender) -> sender.sendMessage(message)); -+ if (new co.aikar.timings.event.TimingsMessageEvent(this.senders, net.kyori.adventure.text.Component.text(message)).callEvent()) { -+ senders.forEach((sender) -> sender.sendMessage(message)); -+ } ++ if (!new co.aikar.timings.event.TimingsMessageEvent(this.senders, net.kyori.adventure.text.Component.text(message)).callEvent()) return; // Parchment + senders.forEach((sender) -> sender.sendMessage(message)); } - public void addConsoleIfNeeded() { diff --git a/src/main/java/co/aikar/timings/event/TimingsEvent.java b/src/main/java/co/aikar/timings/event/TimingsEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..df78c90859999ec18c7b8758e0f1c71281e1abe4 +index 0000000000000000000000000000000000000000..9ad67d72e6173d1629f862ca9fd13475950709f0 --- /dev/null +++ b/src/main/java/co/aikar/timings/event/TimingsEvent.java -@@ -0,0 +1,34 @@ +@@ -0,0 +1,36 @@ +package co.aikar.timings.event; + +import org.bukkit.Bukkit; @@ -135,19 +107,21 @@ index 0000000000000000000000000000000000000000..df78c90859999ec18c7b8758e0f1c712 +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; ++import java.util.HashSet; +import java.util.Set; + +public abstract class TimingsEvent extends Event { + -+ private final Set audience; ++ private final @NotNull Set audience; + private static final HandlerList handlers = new HandlerList(); + -+ public TimingsEvent(Set audience) { ++ public TimingsEvent(@NotNull Collection audience) { + super(!Bukkit.isPrimaryThread()); -+ this.audience = audience; ++ this.audience = new HashSet<>(audience); + } + -+ public Set getAudience() { ++ public @NotNull Set getAudience() { + return this.audience; + } + @@ -156,62 +130,65 @@ index 0000000000000000000000000000000000000000..df78c90859999ec18c7b8758e0f1c712 + return handlers; + } + -+ public static HandlerList getHandlerList() { ++ public static @NotNull HandlerList getHandlerList() { + return handlers; + } + +} diff --git a/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java b/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..5ed7d1d4972842e93e2a9c2ffa799e6fc9136e63 +index 0000000000000000000000000000000000000000..33152129508c526031eee68f2ae797563d97be0c --- /dev/null +++ b/src/main/java/co/aikar/timings/event/TimingsGenerateReportEvent.java -@@ -0,0 +1,19 @@ +@@ -0,0 +1,20 @@ +package co.aikar.timings.event; + +import org.bukkit.command.CommandSender; ++import org.jetbrains.annotations.NotNull; + +import java.util.Collections; + +public class TimingsGenerateReportEvent extends TimingsEvent { + -+ private final String paste; ++ private final @NotNull String paste; + -+ public TimingsGenerateReportEvent(CommandSender sender, String paste) { ++ public TimingsGenerateReportEvent(@NotNull CommandSender sender, @NotNull String paste) { + super(Collections.singleton(sender)); + this.paste = paste; + } + -+ public String getPaste() { ++ public @NotNull String getPaste() { + return this.paste; + } +} diff --git a/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java b/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..04ec925cfa9e385e8ad4763b18570b7bf07c4007 +index 0000000000000000000000000000000000000000..626f25e164c6b23481c5a976a6e184e739104305 --- /dev/null +++ b/src/main/java/co/aikar/timings/event/TimingsMessageEvent.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,35 @@ +package co.aikar.timings.event; + +import net.kyori.adventure.text.Component; +import org.bukkit.command.CommandSender; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + ++import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +public class TimingsMessageEvent extends TimingsEvent implements Cancellable { + -+ public Component message; ++ public @NotNull Component message; + private boolean cancelled; + -+ public TimingsMessageEvent(List senders, Component message) { ++ public TimingsMessageEvent(@NotNull Collection senders, @NotNull Component message) { + super(new HashSet<>(senders)); + this.message = message; + } + -+ public Component getMessage() { ++ public @NotNull Component getMessage() { + return this.message; + } + @@ -227,28 +204,29 @@ index 0000000000000000000000000000000000000000..04ec925cfa9e385e8ad4763b18570b7b +} diff --git a/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java b/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..1fe9bbedf23fdf7b02de02f5d184d8d956c7056b +index 0000000000000000000000000000000000000000..3faf845716d5d3adf360949f28a5e12aa7e20aa6 --- /dev/null +++ b/src/main/java/co/aikar/timings/event/TimingsModifyEvent.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,41 @@ +package co.aikar.timings.event; + +import org.bukkit.command.CommandSender; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +import java.util.Collections; + +public class TimingsModifyEvent extends TimingsEvent implements Cancellable { + -+ private final Action action; ++ private final @NotNull Action action; + private boolean cancelled = false; + -+ public TimingsModifyEvent(CommandSender sender, Action action) { ++ public TimingsModifyEvent(@NotNull CommandSender sender, @NotNull Action action) { + super(Collections.singleton(sender)); + this.action = action; + } + -+ public Action getAction() { ++ public @NotNull Action getAction() { + return this.action; + } + diff --git a/patches/api/0013-Expanded-Insomnia-API-methods.patch b/patches/api/0014-Expanded-Insomnia-API-methods.patch similarity index 90% rename from patches/api/0013-Expanded-Insomnia-API-methods.patch rename to patches/api/0014-Expanded-Insomnia-API-methods.patch index aefc770..cade72f 100644 --- a/patches/api/0013-Expanded-Insomnia-API-methods.patch +++ b/patches/api/0014-Expanded-Insomnia-API-methods.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API methods diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 205cd1d53bef3a8d18315561543f815ede791570..bb67075d04e31865b48e8436876ecf6f342d4d8b 100644 +index 4390fa4cc4616a13855d38cb5e09d60153368428..924dc2c48b77c5c74c6058c661699efeaf72a40d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -49,6 +49,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -61,6 +61,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @Override @NotNull Player getPlayer(); diff --git a/patches/api/0014-Add-NPC-to-EntityType.patch b/patches/api/0015-Add-NPC-to-EntityType.patch similarity index 80% rename from patches/api/0014-Add-NPC-to-EntityType.patch rename to patches/api/0015-Add-NPC-to-EntityType.patch index eaa556f..ff30655 100644 --- a/patches/api/0014-Add-NPC-to-EntityType.patch +++ b/patches/api/0015-Add-NPC-to-EntityType.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add NPC to EntityType diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java -index ee3a3bda9a5b9cf3bcabf80ee3c653a2959fab0c..3e9bf06682373686d0c6f40defc56f23e785cd4b 100644 +index 6cf14afd2c1b8018c67c6cac302ae28bb12ab5a5..9ab641d268cd10a2c9bd888732d4754d520c56c7 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java -@@ -297,6 +297,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans +@@ -295,6 +295,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans */ LIGHTNING("lightning_bolt", LightningStrike.class, -1, false), PLAYER("player", Player.class, -1, false), diff --git a/patches/api/0015-Revert-BungeeChat-Deprecation.patch b/patches/api/0016-Revert-BungeeChat-Deprecation.patch similarity index 68% rename from patches/api/0015-Revert-BungeeChat-Deprecation.patch rename to patches/api/0016-Revert-BungeeChat-Deprecation.patch index 25806f7..8130f0f 100644 --- a/patches/api/0015-Revert-BungeeChat-Deprecation.patch +++ b/patches/api/0016-Revert-BungeeChat-Deprecation.patch @@ -5,21 +5,21 @@ Subject: [PATCH] Revert BungeeChat Deprecation diff --git a/build.gradle.kts b/build.gradle.kts -index cad12a2632b9ebb569280441c42869685db1f31a..50014fbac3aa4f8c7c930405ca89f9cdb83b771c 100644 +index d9f93515f92e35ad27f20ead90952b5ecee86661..4f9582d14c27ab4f8c9e87a26d305988e9edbb61 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -25,7 +25,7 @@ dependencies { +@@ -30,7 +30,7 @@ dependencies { // api dependencies are listed transitively to API consumers api("com.google.guava:guava:31.1-jre") api("com.google.code.gson:gson:2.10") - api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper -+ api("net.md-5:bungeecord-chat:1.16-R0.4") // Parchment - revert - api("org.yaml:snakeyaml:1.33") ++ api("net.md-5:bungeecord-chat:1.16-R0.4") // Paper // Parchment - revert + api("org.yaml:snakeyaml:2.0") api("org.joml:joml:1.10.5") // Paper start -@@ -106,7 +106,7 @@ tasks.withType { - "https://javadoc.io/doc/org.yaml/snakeyaml/1.33/", - "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations +@@ -112,7 +112,7 @@ tasks.withType { + "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", + "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations // Paper start - //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat + "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat // Parchment - revert diff --git a/patches/api/0016-Add-PreEntityShootBowEvent.patch b/patches/api/0017-Add-PreEntityShootBowEvent.patch similarity index 82% rename from patches/api/0016-Add-PreEntityShootBowEvent.patch rename to patches/api/0017-Add-PreEntityShootBowEvent.patch index 9967488..9eba249 100644 --- a/patches/api/0016-Add-PreEntityShootBowEvent.patch +++ b/patches/api/0017-Add-PreEntityShootBowEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add PreEntityShootBowEvent diff --git a/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java b/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..7368e7b039882dd629d187502c5c90d74471590e +index 0000000000000000000000000000000000000000..cd156e2d71728f8d30a12df87398875b1ec8915e --- /dev/null +++ b/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java @@ -0,0 +1,61 @@ @@ -23,22 +23,22 @@ index 0000000000000000000000000000000000000000..7368e7b039882dd629d187502c5c90d7 +public class PreEntityShootBowEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + -+ private final ItemStack bow; -+ private final ItemStack arrow; ++ private final @NotNull ItemStack bow; ++ private final @NotNull ItemStack arrow; + boolean relative = true; + boolean cancelled = false; + -+ public PreEntityShootBowEvent(Entity entity, ItemStack bow, ItemStack arrow) { ++ public PreEntityShootBowEvent(@NotNull Entity entity, @NotNull ItemStack bow, @NotNull ItemStack arrow) { + super(entity); + this.bow = bow; + this.arrow = arrow; + } + -+ public ItemStack getBow() { ++ public @NotNull ItemStack getBow() { + return this.bow; + } + -+ public ItemStack getArrow() { ++ public @NotNull ItemStack getArrow() { + return this.arrow; + } + diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index b5fb1c5..3c71cb4 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -5,21 +5,31 @@ Subject: [PATCH] Build changes diff --git a/build.gradle.kts b/build.gradle.kts -index 9cf389defdaeb887e9cad4f0fed3f3b95667b238..3bd719aace9df13f5d82a6206fb46913efbc4f9f 100644 +index fb98936bb8a5488db75d676c5bcb4060597fbbf8..55e8753d31f371c016cae67e8d5eee002293ac12 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -7,8 +7,8 @@ plugins { - } +@@ -1,4 +1,5 @@ + import io.papermc.paperweight.util.* ++val edenVersion: String by project // Parchment + + plugins { + java +@@ -13,8 +14,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { + val alsoShade: Configuration by configurations.creating dependencies { - implementation(project(":paper-api")) - implementation(project(":paper-mojangapi")) -+ implementation(project(":parchment-api")) // Parchment -+ implementation("io.papermc.paper:paper-mojangapi:${project.version}") // Parchment ++ // Parchment start ++ implementation(project(":parchment-api")) ++ implementation("io.papermc.paper:paper-mojangapi:${project.version}") { ++ exclude("io.papermc.paper", "paper-api") ++ } ++ // Parchment end // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -62,7 +62,7 @@ tasks.jar { +@@ -72,7 +77,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -28,7 +38,7 @@ index 9cf389defdaeb887e9cad4f0fed3f3b95667b238..3bd719aace9df13f5d82a6206fb46913 "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -79,7 +79,27 @@ tasks.jar { +@@ -94,7 +99,27 @@ tasks.compileJava { publishing { publications.create("maven") { @@ -57,7 +67,7 @@ index 9cf389defdaeb887e9cad4f0fed3f3b95667b238..3bd719aace9df13f5d82a6206fb46913 } } -@@ -134,7 +154,7 @@ fun TaskContainer.registerRunTask( +@@ -149,7 +174,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -80,34 +90,27 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..bf6d9879810359216a60d1efe1d1bd9e /** diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index bf42969859545a8a520923ef1836ffa4a5cc24a0..2532e265c5dade55f71c34fcab6d1e74bbb58a87 100644 +index 9d687da5bdf398bb3f6c84cdf1249a7213d09f2e..9b248dde91651b40b6b3e3dda8985c73543b4922 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -31,8 +31,8 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -31,8 +31,10 @@ public class PaperVersionFetcher implements VersionFetcher { @Nonnull @Override public Component getVersionMessage(@Nonnull String serverVersion) { - String[] parts = serverVersion.substring("git-Paper-".length()).split("[-\\s]"); - final Component updateMessage = getUpdateStatusMessage("PaperMC/Paper", GITHUB_BRANCH_NAME, parts[0]); -+ String[] parts = serverVersion.substring("git-Parchment-".length()).split("[-\\s]"); // Parchment -+ final Component updateMessage = getUpdateStatusMessage("ProjectEdenGG/Parchment", GITHUB_BRANCH_NAME, parts[0]); // Parchment ++ // Parchment start ++ String[] parts = serverVersion.substring("git-Parchment-".length()).split("[-\\s]"); ++ final Component updateMessage = getUpdateStatusMessage("ProjectEdenGG/Parchment", GITHUB_BRANCH_NAME, parts[0]); ++ // Parchment end final Component history = getHistory(); return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; -@@ -45,7 +45,7 @@ public class PaperVersionFetcher implements VersionFetcher { - String result = matcher.group(); - mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-' - } else { -- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!"); -+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to ProjectEdenGG!"); - org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString()); - org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion()); - } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..ec1a0f01c116c0a34807e1903b8142509d456b0e 100644 +index 3238cbcba567b1242c77e41f6b6f19a8d157fb4e..deccd238278f003ead4d8973004b3965f077bfff 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1682,7 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoopLF;);w$B`lqgZeCg3~3 eobo8H4*VC(Unzh*$|>Fe0000O -literal 14310 -zcmXY21yoy2uugDycPmm{N^yd_Q`}vP7YOd|PH`>8wLo!q*HRn`6f5rV?*HD)IX5{c -zxpy-=`|Zxo_svGBD$Agwkf4A-AaprdNp;|J21vifLD%hMrT$lZeEex|7Xe0mqFAZArC{!qp)zJmbab@utqA`6 -z61Z~|e!k$IbXNT?PvGuuzT7G514$8e!}lsR>%nURMm+~pde``@(!O=ISt0%B93;Ez -za-qRi4n0Q>zQ2#2^_y08QOl3jT*!Ir5@<8VrFx(6f9sP|H8ttjftN;wrX>jP4BcG1;MfU5x^L`zc09u!bDBt#+ll=7@ -zB;}A$BKgu}V?#qfHvm`~pt%wG2y{MOc%B!8I`p|pc -zO#?sq!Zd&j8UPmvY4RQnfo>!6{a}GFV!}g@qu<3Wu$07X(O`vikNW$~q!ngF23Ls2 -z53p8js<-B_Qd?xX6rtq43Mdz(jOg2QXx#Wng_9^1^^~KqFNq{Kvb@Ap9}bf&xFA-C -z5+#cQ`#v$A=kd0O=agATcleBaxXf_(dnqbQz|cL9R&&Ni1omTs+6~YApmk)MCghxj -z1}mq&IU>1nEiF=q=PI`%jQbyRd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DGZz<4^FBXBq5F)zwTQ|65$~FTfyft2wOiY&QG(ydKoz#wa?YKny +z)9C@EX0c#XN}}K5dNFdMNo^+Os>0sS^c;E5Ky4zm)q;>J{J+z3sdUj)7tN@@gZSf7 +zJ|wiD$oI`e{Xe-gDV9P_(x}i7AaPVJn&m~NMi(84-RGbXy6@{lY?h66ze7!6Ee=i! +zInre-6PCHrI9+8v4+)Zge*esLVEy0*)t)o|)801Zf98hgQ=EZH2bpZ=)5NN_2yjw# +zP8Ewr(5WN{8DJpt*e!|G(gvZ5Pxywag$Agdns%%4+IH>|FMw9b +zKb<-v)*Cb*Ao~hb;B*`Ee&trZYBi`{$ru%gmKbuXcPNb3lD3H3Jimki7;BEFp{bxX +zFJ7Rk<~$d5(AGs1%w=$DDrj&3=?C4wX`U{m8^^=Z8R3YTB_A>ZAOkmldWl +zwo0ZyTNCB`dfUZA+chm*()HWtA2!JQ3>g${8%Vr% +zasf==&095e)fG}M%iIsk{PaQ>2|D59ppz^2pExvb9Ou9EI^`kN!0aXr*u3p0ex0b4 +z=AnHH#@v>`#o*LjN-yB0^^l)H2Nm=yD3|>1aNigv$f`s680kxF8B%d>SUG)YF0R~W +z$TI5rvll2~&q4RSwu3})*@1!~z4l}@NsY#MwV(2Y=hbLZh-ce*Eq3<#rZ +zxra}au9h@`-JaCDeW|)St?N40z`g~4rjZ?xu=?#W;cJyHNPXCV2DuxD%N1A2hAlFH +zwTJm(6XPn#dA&{dq>&yd{5Lp=pa<%$*em=~TdQ%rn_v#5`>I!IS>M^uNpl#N|wC@HMBcRTMT#SL;d7 +z<(&BuA6dLkkx|8fWw@PXzCeCBgDx@HJs@)L+j8y~gZ)7)${p-|O7{G? +z&|M6FI|A*^d_U+Of-3`+w(c~-YsQby|NH)g|G7xv|Nek^|Jex)g~z+)I0xPC0460S +LFIp>X81%mY^Bg|U diff --git a/patches/server/0002-Temporary-Access-Transformers.patch b/patches/server/0002-Temporary-Access-Transformers.patch index c98dfd4..6a73748 100644 --- a/patches/server/0002-Temporary-Access-Transformers.patch +++ b/patches/server/0002-Temporary-Access-Transformers.patch @@ -4,8 +4,25 @@ Date: Sat, 19 Jun 2021 18:03:59 -0400 Subject: [PATCH] Temporary Access Transformers +diff --git a/src/main/java/net/minecraft/core/Holder.java b/src/main/java/net/minecraft/core/Holder.java +index 996e1a8485ae3c6a698d846f8cbe9add51a4be03..312ccb54046fbf7b5f7a0103721cf7878700e895 100644 +--- a/src/main/java/net/minecraft/core/Holder.java ++++ b/src/main/java/net/minecraft/core/Holder.java +@@ -126,6 +126,12 @@ public interface Holder { + return new Holder.Reference<>(Holder.Reference.Type.INTRUSIVE, owner, (ResourceKey)null, value); + } + ++ // Parchment start ++ public static Holder.Reference create(HolderOwner owner, @Nullable ResourceKey registryKey, @Nullable T value) { ++ return new Holder.Reference<>(Holder.Reference.Type.STAND_ALONE, owner, registryKey, value); ++ } ++ // Parchment end ++ + public ResourceKey key() { + if (this.key == null) { + throw new IllegalStateException("Trying to access unbound value '" + this.value + "' from registry " + this.owner); diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index b0204af850ee182773ad458208cccd946ad148d5..92980f04bc1bac9924907007eb63fd04eba3875c 100644 +index ebee8de2ed831755b6fd154f6cc77ac993839bb9..0bf4ef77bd61f6d28faf497f5bd0ceecd8663daf 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java @@ -207,7 +207,7 @@ public class BlockItem extends Item { diff --git a/patches/server/0003-Add-SoundEvent.patch b/patches/server/0003-Add-SoundEvent.patch index 5127743..0d22abc 100644 --- a/patches/server/0003-Add-SoundEvent.patch +++ b/patches/server/0003-Add-SoundEvent.patch @@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a + } +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -index ecddb6fe55e8ee1ca3b163503dd62200ce2d7d04..7d613f50cd0c6469a74529a834f30490defdaa00 100644 +index db54a9c32578defa02fa58dc694c96684a4885ac..6c2477f066f887557e89456994a49ddaf1f8aa27 100644 --- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -@@ -325,6 +325,32 @@ public final class PaperAdventure { +@@ -339,6 +339,40 @@ public final class PaperAdventure { return asVanilla(source); } @@ -62,8 +62,16 @@ index ecddb6fe55e8ee1ca3b163503dd62200ce2d7d04..7d613f50cd0c6469a74529a834f30490 + }; + } + -+ public static java.util.Optional asVanillaSound(final Key key) { -+ return net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.getOptional(asVanilla(key)); ++ public static Optional asVanillaSound(final Key key) { ++ return BuiltInRegistries.SOUND_EVENT.getOptional(asVanilla(key)); ++ } ++ ++ public static Optional> asSoundHolder(final net.minecraft.resources.ResourceKey key) { ++ return BuiltInRegistries.SOUND_EVENT.getHolder(key); ++ } ++ ++ public static Optional> asVanillaSoundHolder(final Key key) { ++ return asSoundHolder(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, asVanilla(key))); + } + + @SuppressWarnings("PatternValidation") @@ -72,62 +80,67 @@ index ecddb6fe55e8ee1ca3b163503dd62200ce2d7d04..7d613f50cd0c6469a74529a834f30490 + } + // Parchment end + - // NBT - - public static @Nullable BinaryTagHolder asBinaryTagHolder(final @Nullable CompoundTag tag) { + public static Packet asSoundPacket(final Sound sound, final double x, final double y, final double z, final long seed, @Nullable BiConsumer, Float> packetConsumer) { + final ResourceLocation name = asVanilla(sound.name()); + final Optional soundEvent = BuiltInRegistries.SOUND_EVENT.getOptional(name); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5a5ff40df37db9cbd53c584ed26a3ce4888b29c0..30c05db4ad0fcd5aa83cb3168ed32c7b0d205972 100644 +index 18aac3da3c88f33b1a71a5920a8daa27e9723913..1727c741664b981311b69fadc849ac6de5423a6a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1718,6 +1718,43 @@ public class ServerLevel extends Level implements WorldGenLevel { - this.neighborUpdater.neighborChanged(state, pos, sourceBlock, sourcePos, notify); - } +@@ -1753,12 +1753,46 @@ public class ServerLevel extends Level implements WorldGenLevel { -+ public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) { + @Override + public void playSeededSound(@Nullable Player except, double x, double y, double z, Holder sound, SoundSource category, float volume, float pitch, long seed) { +- this.server.getPlayerList().broadcast(except, x, y, z, (double) ((SoundEvent) sound.value()).getRange(volume), this.dimension(), new ClientboundSoundPacket(sound, category, x, y, z, volume, pitch, seed)); + // Parchment start - sound event + CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent( + except == null ? null : except.getBukkitEntity(), -+ net.kyori.adventure.sound.Sound.sound( -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.getLocation()), -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(category), -+ volume, -+ pitch -+ ), ++ net.kyori.adventure.sound.Sound.sound() ++ .type(sound.unwrap().map( ++ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()), ++ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation()) ++ )) ++ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category)) ++ .volume(volume) ++ .pitch(pitch) ++ .seed(seed) ++ .build(), + gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(this, x, y, z), -+ seed, + gg.projecteden.parchment.event.sound.ParchmentSoundEvent.DISTANCE_FUNCTION, + null + )); + // Parchment end -+ } -+ -+ @Override -+ public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) { + } + + @Override + public void playSeededSound(@Nullable Player except, Entity entity, Holder sound, SoundSource category, float volume, float pitch, long seed) { +- this.server.getPlayerList().broadcast(except, entity.getX(), entity.getY(), entity.getZ(), (double) ((SoundEvent) sound.value()).getRange(volume), this.dimension(), new ClientboundSoundEntityPacket(sound, category, entity, volume, pitch, seed)); + // Parchment start - sound event + CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent( + except == null ? null : except.getBukkitEntity(), -+ net.kyori.adventure.sound.Sound.sound( -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.getLocation()), -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(category), -+ volume, -+ pitch -+ ), ++ net.kyori.adventure.sound.Sound.sound() ++ .type(sound.unwrap().map( ++ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()), ++ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation()) ++ )) ++ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category)) ++ .volume(volume) ++ .pitch(pitch) ++ .seed(seed) ++ .build(), + gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(entity), -+ seed, + gg.projecteden.parchment.event.sound.ParchmentSoundEvent.DISTANCE_FUNCTION, + null + )); + // Parchment end -+ } -+ + } + @Override - public void broadcastEntityEvent(Entity entity, byte status) { - this.getChunkSource().broadcastAndSend(entity, new ClientboundEntityEventPacket(entity, status)); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 1d4d02f26391ac55c7631817f09d05e2769b0d29..cbcc4141c904360127780d6441a960842e661ef0 100644 +index dc5fda83a66afbfeb7897fc20b4742899d8aca08..6a5c781cf14521659426cf30bd1c46cd65814df4 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2270,7 +2270,19 @@ public class ServerPlayer extends Player { +@@ -2328,7 +2328,20 @@ public class ServerPlayer extends Player { @Override public void playNotifySound(SoundEvent event, SoundSource category, float volume, float pitch) { @@ -135,24 +148,25 @@ index 1d4d02f26391ac55c7631817f09d05e2769b0d29..cbcc4141c904360127780d6441a96084 + // Parchment start - sound event + CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent( + null, -+ net.kyori.adventure.sound.Sound.sound( -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(event.getLocation()), -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(category), -+ volume, -+ pitch -+ ), -+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(level, getX(), getY(), getZ()), -+ this.random.nextLong(), sound -> 0d, soundEvent -> java.util.Collections.singletonList(getBukkitEntity()) ++ net.kyori.adventure.sound.Sound.sound() ++ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(event.getLocation())) ++ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category)) ++ .volume(volume) ++ .pitch(pitch) ++ .seed(this.random.nextLong()) ++ .build(), ++ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(level(), getX(), getY(), getZ()), ++ sound -> 0d, soundEvent -> java.util.Collections.singletonList(getBukkitEntity()) + )); + // Parchment end } @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index c0c14766adaac855112f85a203a6163b8adfdded..d59d36c8a77524d5ac0c25a4ef1cf57f339eeda2 100644 +index 640e9bd618dc8286933318744c2064ede1fd9b5f..38eae743afa3c517c59bb1df83b1871d06165dbc 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -932,7 +932,7 @@ public abstract class PlayerList { +@@ -947,7 +947,7 @@ public abstract class PlayerList { BlockState data = worldserver1.getBlockState(blockposition); worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3); } @@ -162,25 +176,25 @@ index c0c14766adaac855112f85a203a6163b8adfdded..d59d36c8a77524d5ac0c25a4ef1cf57f } // Added from changeDimension 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 0629c471d38a77c44fc1c86ccdfcb0690f61ca17..791e9f43afae265f7f32588db2d6f2092c5f32c7 100644 +index 58152160d609d0e9d105153aeb166a56a7955603..7a4a07cd0618e7d51be0824e9102e979dfbdc7e6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1891,7 +1891,21 @@ public abstract class Player extends LivingEntity { +@@ -1918,7 +1918,21 @@ public abstract class Player extends LivingEntity { private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { - fromEntity.level.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself + fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself if (fromEntity instanceof ServerPlayer) { - ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong())); + // Parchment start - sound event + CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent( + null, -+ net.kyori.adventure.sound.Sound.sound( -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.getLocation()), -+ io.papermc.paper.adventure.PaperAdventure.asAdventure(soundCategory), -+ volume, -+ pitch -+ ), -+ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(fromEntity.level, x, y, z), -+ fromEntity.random.nextLong(), ++ net.kyori.adventure.sound.Sound.sound() ++ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.getLocation())) ++ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundCategory)) ++ .volume(volume) ++ .pitch(pitch) ++ .seed(fromEntity.random.nextLong()) ++ .build(), ++ gg.projecteden.parchment.event.sound.ParchmentSoundEvent.createEmitter(fromEntity.level(), x, y, z), + sound -> 0d, + soundEvent -> java.util.Collections.singletonList(((ServerPlayer) fromEntity).getBukkitEntity()) + )); @@ -189,7 +203,7 @@ index 0629c471d38a77c44fc1c86ccdfcb0690f61ca17..791e9f43afae265f7f32588db2d6f209 } // Paper end diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java -index 879c3bb661e24b9682b654def57c2800f4f8ca92..78c2067b9683611ea31cfe1c95755aa9e23e5982 100644 +index f7399737548483905f3b5c08a03876b0da54b714..e668de87a5b58febf451fe4be79e47143f4eab01 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raid.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java @@ -538,7 +538,7 @@ public class Raid { @@ -202,44 +216,33 @@ index 879c3bb661e24b9682b654def57c2800f4f8ca92..78c2067b9683611ea31cfe1c95755aa9 } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cdb8ec04f4a19ec3dbedbd5b17a7d1f3afaa238e..42b9f8d0b038a26fb3689bc0e974ceeed4de4254 100644 +index 26e1a9002d675245d4cf91e6682605314b078fb2..9d5b1851f719cb51a64f7aa904268867f1855d72 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1945,4 +1945,53 @@ public class CraftEventFactory { - return event.callEvent(); +@@ -2106,4 +2106,42 @@ public class CraftEventFactory { + return event; } - // Paper end + // Paper end - add EntityFertilizeEggEvent + + // Parchment start + private static net.minecraft.network.protocol.@org.jetbrains.annotations.NotNull Packet handleSoundEvent(gg.projecteden.parchment.event.sound.SoundEvent event, CraftPlayer recipient) { -+ // init variables + net.kyori.adventure.sound.Sound sound = event.calculateSound(recipient); ++ ResourceLocation name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name()); + gg.projecteden.parchment.event.sound.SoundEvent.Emitter emitter = event.calculateEmitter(recipient); + net.minecraft.sounds.SoundSource source = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()); + float volume = sound.volume(); + float pitch = sound.pitch(); -+ long seed = event.getSeed(); -+ java.util.Optional soundEvent = io.papermc.paper.adventure.PaperAdventure.asVanillaSound(sound.name()); -+ // handle vanilla sounds -+ if (soundEvent.isPresent()) { -+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter) -+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(net.minecraft.core.Holder.direct(soundEvent.get()), source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed); -+ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) { -+ Location loc = locationEmitter.location(); -+ return new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.Holder.direct(soundEvent.get()), source, loc.getX(), loc.getY(), loc.getZ(), volume, pitch, seed); -+ } -+ else -+ throw new IllegalArgumentException("Unknown emitter type: " + emitter.getClass().getName()); -+ } -+ // handle custom sounds -+ else { -+ return null; // ClientboundCustomSoundPacket was removed and the standard packet now supports custom sounds -+// // warn if trying to use EntityEmitter with custom sound -+// if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter) -+// org.slf4j.LoggerFactory.getLogger("SoundEvent").warn("Sound event is using a custom sound ({}) which cannot be used with EntityEmitter. Falling back to playing at the entity's location.", sound.name().asString()); -+// Vec3 pos = org.bukkit.craftbukkit.util.CraftVector.toNMS(emitter.location().toVector()); -+// return new net.minecraft.network.protocol.game.ClientboundCustomSoundPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name()), source, pos, volume, pitch, seed); ++ long seed = sound.seed().orElse(0L); // TODO: random source? ++ net.minecraft.resources.ResourceKey soundKey = net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, name); ++ net.minecraft.core.Holder.Reference soundEvent = io.papermc.paper.adventure.PaperAdventure.asVanillaSoundHolder(sound.name()) // TODO: calculate event distance? ++ .orElseGet(() -> net.minecraft.core.Holder.Reference.create(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.holderOwner(), soundKey, net.minecraft.sounds.SoundEvent.createFixedRangeEvent(name, (float) event.calculateDistance()))); ++ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter) ++ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(soundEvent, source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed); ++ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) { ++ org.bukkit.Location loc = locationEmitter.getLocation(); ++ return new net.minecraft.network.protocol.game.ClientboundSoundPacket(soundEvent, source, loc.getX(), loc.getY(), loc.getZ(), volume, pitch, seed); + } ++ throw new IllegalArgumentException("Unknown emitter type: " + emitter.getClass().getName()); + } + + public static void playSoundEvent(gg.projecteden.parchment.event.sound.SoundEvent event) { diff --git a/patches/server/0004-Add-PlayerUseRespawnAnchorEvent.patch b/patches/server/0004-Add-PlayerUseRespawnAnchorEvent.patch index acd490e..be63752 100644 --- a/patches/server/0004-Add-PlayerUseRespawnAnchorEvent.patch +++ b/patches/server/0004-Add-PlayerUseRespawnAnchorEvent.patch @@ -5,22 +5,21 @@ Subject: [PATCH] Add PlayerUseRespawnAnchorEvent diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -index bcea8af63b9911c36873290e5c34567b1eeaacf4..a630bba5d7b8e5e18346cd2b8cc5d6dbc66c8a53 100644 +index 2ed78cf83c0ae66a6ddba1ff307da89a24b0d0a8..e9f80170f85906c70898c7a04b9a16497a7d2994 100644 --- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -52,23 +52,46 @@ public class RespawnAnchorBlock extends Block { - @Override +@@ -58,23 +58,45 @@ public class RespawnAnchorBlock extends Block { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - ItemStack itemStack = player.getItemInHand(hand); -+ + ItemStack itemstack = player.getItemInHand(hand); + + // Parchment start -- PlayerUseRespawnAnchorEvent + org.bukkit.entity.Player bukkitPlayer = player.getBukkitEntity() instanceof org.bukkit.entity.Player ? (org.bukkit.entity.Player) player.getBukkitEntity() : null; + org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos); + gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult result; + // Parchment end - if (hand == InteractionHand.MAIN_HAND && !isRespawnFuel(itemStack) && isRespawnFuel(player.getItemInHand(InteractionHand.OFF_HAND))) { + if (hand == InteractionHand.MAIN_HAND && !RespawnAnchorBlock.isRespawnFuel(itemstack) && RespawnAnchorBlock.isRespawnFuel(player.getItemInHand(InteractionHand.OFF_HAND))) { return InteractionResult.PASS; - } else if (isRespawnFuel(itemStack) && canBeCharged(state)) { + } else if (RespawnAnchorBlock.isRespawnFuel(itemstack) && RespawnAnchorBlock.canBeCharged(state)) { + // Parchment start -- PlayerUseRespawnAnchorEvent + result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE; + } else if (state.getValue(CHARGE) == 0) { @@ -41,25 +40,25 @@ index bcea8af63b9911c36873290e5c34567b1eeaacf4..a630bba5d7b8e5e18346cd2b8cc5d6db + return InteractionResult.PASS; + } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) { + // Parchment end - charge(player, world, pos, state); + RespawnAnchorBlock.charge(player, world, pos, state); if (!player.getAbilities().instabuild) { - itemStack.shrink(1); + itemstack.shrink(1); } return InteractionResult.sidedSuccess(world.isClientSide); -- } else if (state.getValue(CHARGE) == 0) { +- } else if ((Integer) state.getValue(RespawnAnchorBlock.CHARGE) == 0) { - return InteractionResult.PASS; -- } else if (!canSetSpawn(world)) { +- } else if (!RespawnAnchorBlock.canSetSpawn(world)) { - if (!world.isClientSide) { - this.explode(state, world, pos); - } - - return InteractionResult.sidedSuccess(world.isClientSide); -+ // Parchment start -- PlayerUseRespawnAnchorEvent ++ // Parchment start -- PlayerUseRespawnAnchorEvent + } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.EXPLODE) { + this.explode(state, world, pos); + return InteractionResult.CONSUME; + // Parchment end } else { if (!world.isClientSide) { - ServerPlayer serverPlayer = (ServerPlayer)player; + ServerPlayer entityplayer = (ServerPlayer) player; diff --git a/patches/server/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch b/patches/server/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch index fdbc32f..be5a5e2 100644 --- a/patches/server/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch +++ b/patches/server/0005-Add-origin-location-to-EntityDamageByBlockEvent.patch @@ -5,33 +5,33 @@ Subject: [PATCH] Add origin location to EntityDamageByBlockEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 42b9f8d0b038a26fb3689bc0e974ceeed4de4254..7f6266a0b4703a580571928fa4aa1a5b0caf0a39 100644 +index 9d5b1851f719cb51a64f7aa904268867f1855d72..e2012fd752c3a5dcf604d7892bf3e01c354ce275 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -971,7 +971,7 @@ public class CraftEventFactory { +@@ -1021,7 +1021,7 @@ public class CraftEventFactory { CraftEventFactory.entityDamage = null; EntityDamageEvent event; if (damager == null) { -- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions); -+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, source.getEntity().getBukkitEntity().getLocation(), modifiers, modifierFunctions); +- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState); // Paper - handle block state in damage ++ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions, source.explodedBlockState, source.getEntity().getBukkitEntity().getLocation()); // Paper - handle block state in damage } else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) { event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions); } else { -@@ -1014,7 +1014,7 @@ public class CraftEventFactory { +@@ -1069,7 +1069,7 @@ public class CraftEventFactory { return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API - } else if (source.is(DamageTypes.OUT_OF_WORLD)) { + } else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) { - EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions); -+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, entity.getBukkitEntity().getLocation(), modifiers, modifierFunctions); ++ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions, null, entity.getBukkitEntity().getLocation()); event.setCancelled(cancelled); CraftEventFactory.callEvent(event); if (!event.isCancelled()) { -@@ -1024,7 +1024,7 @@ public class CraftEventFactory { +@@ -1079,7 +1079,7 @@ public class CraftEventFactory { } return event; } else if (source.is(DamageTypes.LAVA)) { - EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions)); -+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, blockDamage.getLocation(), modifiers, modifierFunctions)); ++ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions, null, blockDamage.getLocation())); event.setCancelled(cancelled); Block damager = CraftEventFactory.blockDamage; diff --git a/patches/server/0006-Add-UnsafeValues-canPlaceItemOn.patch b/patches/server/0006-Add-UnsafeValues-canPlaceItemOn.patch index 9f23299..be4ef9d 100644 --- a/patches/server/0006-Add-UnsafeValues-canPlaceItemOn.patch +++ b/patches/server/0006-Add-UnsafeValues-canPlaceItemOn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 64c50c52c11214740de7903e5592b8b6b2c170b3..be2739875ba1ba1a973c4a45c7e6a6996f0daf31 100644 +index 83cef5ec27c31f133a23cd27349f722799c786ea..dae633aed4da8f10a94801486c1208ac996ca23e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -618,6 +618,55 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -624,6 +624,55 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end diff --git a/patches/server/0007-Add-Player-setGameProfile.patch b/patches/server/0007-Add-Player-setGameProfile.patch index db5332f..faaaec8 100644 --- a/patches/server/0007-Add-Player-setGameProfile.patch +++ b/patches/server/0007-Add-Player-setGameProfile.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#setGameProfile 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 791e9f43afae265f7f32588db2d6f2092c5f32c7..460edabad8327acd4ba86924a220605181a97cd8 100644 +index 7a4a07cd0618e7d51be0824e9102e979dfbdc7e6..2a9cd25b0a2bb90a91efd981572923436b53c02f 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1509,6 +1509,12 @@ public abstract class Player extends LivingEntity { +@@ -1510,6 +1510,12 @@ public abstract class Player extends LivingEntity { return this.gameProfile; } diff --git a/patches/server/0008-Expose-MCUtil-Executors.patch b/patches/server/0008-Expose-MCUtil-Executors.patch index c1a03df..388df84 100644 --- a/patches/server/0008-Expose-MCUtil-Executors.patch +++ b/patches/server/0008-Expose-MCUtil-Executors.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose MCUtil Executors diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2a8ad9afaa53d80d3926d9f1e1181c54aa8a849e..bc70b8d1e0954196a82e8673bc49b9438a4d838f 100644 +index 429f492aa0802a0456487aa52c22ec6902079616..a165f8f14b1e6feec49c349e26b91d76395f3cfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2919,4 +2919,16 @@ public final class CraftServer implements Server { +@@ -3115,4 +3115,16 @@ public final class CraftServer implements Server { } // Paper end diff --git a/patches/server/0009-Fix-missing-CraftMetaSkull-serializedProfile.patch b/patches/server/0009-Fix-missing-CraftMetaSkull-serializedProfile.patch index a32e8e3..94bd120 100644 --- a/patches/server/0009-Fix-missing-CraftMetaSkull-serializedProfile.patch +++ b/patches/server/0009-Fix-missing-CraftMetaSkull-serializedProfile.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix missing CraftMetaSkull serializedProfile Plugins (ab)using NMS may change the "profile" field using reflections instead of the "setProfile" method, especially if they are targeted towards old Minecraft versions. This fixes the potential discrepancies and NPEs. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index deed77a3d44bc55681483d7f47f148b5220135f2..5b4100f0fcd29660b4738d908d2bda677f206cc4 100644 +index 47c8148e6413c51ffdd30082bfb37a7fb8a73a71..fe48cb0fbf3b510b365bed06d84c0c62edd1ad19 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -@@ -131,6 +131,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -133,6 +133,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { private void setProfile(GameProfile profile) { this.profile = profile; @@ -21,7 +21,7 @@ index deed77a3d44bc55681483d7f47f148b5220135f2..5b4100f0fcd29660b4738d908d2bda67 this.serializedProfile = (profile == null) ? null : NbtUtils.writeGameProfile(new CompoundTag(), profile); } -@@ -139,6 +144,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -141,6 +146,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { super.applyToItem(tag); if (this.profile != null) { @@ -29,7 +29,7 @@ index deed77a3d44bc55681483d7f47f148b5220135f2..5b4100f0fcd29660b4738d908d2bda67 // SPIGOT-6558: Set initial textures tag.put(SKULL_OWNER.NBT, serializedProfile); // Fill in textures -@@ -301,6 +307,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -303,6 +309,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { if (meta instanceof CraftMetaSkull) { CraftMetaSkull that = (CraftMetaSkull) meta; diff --git a/patches/server/0010-Add-BlockDropResourcesEvent.patch b/patches/server/0010-Add-BlockDropResourcesEvent.patch index f36a2c0..7573a89 100644 --- a/patches/server/0010-Add-BlockDropResourcesEvent.patch +++ b/patches/server/0010-Add-BlockDropResourcesEvent.patch @@ -8,19 +8,10 @@ to easily get the items being dropped by any block instead of only blocks broken by players. 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 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993febdee50 100644 +index 9522e646529f3d849471931b4b3c0d133e7fcfc5..cbdcbfed03afbdf194243d4472e69a664dcf71b9 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -306,7 +306,7 @@ public class Block extends BlockBehaviour implements ItemLike { - ServerLevel worldserver = lootContext.getLevel(); - BlockPos blockposition = BlockPos.containing((Position) lootContext.getParameter(LootContextParams.ORIGIN)); - -- state.getDrops(lootContext).forEach((itemstack) -> { -+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(worldserver, blockposition, state.getDrops(lootContext)).forEach((itemstack) -> { // Parchment - Block.popResource(worldserver, blockposition, itemstack); - }); - state.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, true); -@@ -314,7 +314,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -302,7 +302,7 @@ public class Block extends BlockBehaviour implements ItemLike { public static void dropResources(BlockState state, Level world, BlockPos pos) { if (world instanceof ServerLevel) { @@ -29,7 +20,7 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993 Block.popResource(world, pos, itemstack); }); state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true); -@@ -324,7 +324,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -312,7 +312,7 @@ public class Block extends BlockBehaviour implements ItemLike { public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) { if (world instanceof ServerLevel) { @@ -38,21 +29,20 @@ index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993 Block.popResource((ServerLevel) world, pos, itemstack); }); state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true); -@@ -351,7 +351,8 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -339,7 +339,7 @@ public class Block extends BlockBehaviour implements ItemLike { - public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack tool) { + public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) { if (world instanceof ServerLevel) { - Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> { -+ + org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment Block.popResource(world, pos, itemstack1); }); state.spawnAfterBreak((ServerLevel) world, pos, tool, true); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7f6266a0b4703a580571928fa4aa1a5b0caf0a39..7681fc8163f6ac17a7d26fd6f5c5113eb634640e 100644 +index e2012fd752c3a5dcf604d7892bf3e01c354ce275..694158155deb70d0be219a03e2302535d32ef558 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1993,5 +1993,19 @@ public class CraftEventFactory { +@@ -2143,5 +2143,19 @@ public class CraftEventFactory { } }); } diff --git a/patches/server/0011-Add-Furnace-Recipe-API.patch b/patches/server/0011-Add-Furnace-Recipe-API.patch index 85cb8fc..4d20c2c 100644 --- a/patches/server/0011-Add-Furnace-Recipe-API.patch +++ b/patches/server/0011-Add-Furnace-Recipe-API.patch @@ -215,10 +215,10 @@ index 0000000000000000000000000000000000000000..e7114e456f818d7bdd4081620f4b9b93 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5e9055fdf411029ea2fed91acd6b981f79156418..9f719150a0369ddb76da88635e05ff701759a1ed 100644 +index 1a481fb4f4228f0fea8a7dc6132248c98b727c90..03553404519e7ac1e404a2cff36062ef6bcda36f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2395,4 +2395,11 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2437,4 +2437,11 @@ public class CraftWorld extends CraftRegionAccessor implements World { return this.adventure$pointers; } // Paper end diff --git a/patches/server/0012-Disable-sleep-status-announcements.patch b/patches/server/0012-Disable-sleep-status-announcements.patch index f47ad63..d257c5d 100644 --- a/patches/server/0012-Disable-sleep-status-announcements.patch +++ b/patches/server/0012-Disable-sleep-status-announcements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable sleep status announcements diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 30c05db4ad0fcd5aa83cb3168ed32c7b0d205972..206bc729f24f679bed3b945b640778873699676a 100644 +index 1727c741664b981311b69fadc849ac6de5423a6a..417f8621b80702f1b64aa618b279a606a3a3b7f9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -974,7 +974,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1116,7 +1116,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } private void announceSleepStatus() { diff --git a/patches/server/0013-Add-config-for-ticking-TIME_SINCE_REST.patch b/patches/server/0013-Add-config-for-ticking-TIME_SINCE_REST.patch index c912d4f..878474e 100644 --- a/patches/server/0013-Add-config-for-ticking-TIME_SINCE_REST.patch +++ b/patches/server/0013-Add-config-for-ticking-TIME_SINCE_REST.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config for ticking TIME_SINCE_REST diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -index 4532f3a0d74feae0a1249b53e1bfbc18a8808b32..c66db0468a9ab09cc89805e7bf7be09e7a7a1746 100644 +index a33de97340f14219291c4175e9194914cdf441db..a6341580f9c1a163ddb9c380a2c5c1658cb5bf0d 100644 --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -@@ -259,6 +259,7 @@ public class WorldConfiguration extends ConfigurationPart { +@@ -265,6 +265,7 @@ public class WorldConfiguration extends ConfigurationPart { } public boolean disablePlayerCrits = false; @@ -17,15 +17,15 @@ index 4532f3a0d74feae0a1249b53e1bfbc18a8808b32..c66db0468a9ab09cc89805e7bf7be09e public PillagerPatrols pillagerPatrols; 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 e428299aff0a75b8a9a82cac13429a6dc7ea7002..defe3bdf04b274f16e99c7d25e5f167480465c09 100644 +index 2a9cd25b0a2bb90a91efd981572923436b53c02f..d904529cb725f751cfc8ba5ff911d2f6972022bc 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -291,7 +291,7 @@ public abstract class Player extends LivingEntity { +@@ -292,7 +292,7 @@ public abstract class Player extends LivingEntity { this.awardStat(Stats.CROUCH_TIME); } - if (!this.isSleeping()) { -+ if (!this.isSleeping() && this.level.paperConfig().entities.behavior.tickTimeSinceSleep) { // Parchment ++ if (!this.isSleeping() && this.level().paperConfig().entities.behavior.tickTimeSinceSleep) { // Parchment this.awardStat(Stats.TIME_SINCE_REST); } } diff --git a/patches/server/0014-Add-HangingFrame-Tick-API.patch b/patches/server/0014-Add-HangingFrame-Tick-API.patch index ab7c7d6..417cf1f 100644 --- a/patches/server/0014-Add-HangingFrame-Tick-API.patch +++ b/patches/server/0014-Add-HangingFrame-Tick-API.patch @@ -5,25 +5,25 @@ Subject: [PATCH] Add HangingFrame Tick API diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java -index f7d031e9a5aa533d78a49ed6147dd47dd0f27f01..a22139bd4202237eb6977b95786b9a3647821874 100644 +index 66cf0a6cd1525ecf2615809210a26d55f445d07d..360ca6458083fa4018f11fcdade3ce930835db72 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java -@@ -42,6 +42,7 @@ public abstract class HangingEntity extends Entity { - private int checkInterval; { this.checkInterval = this.getId() % this.level.spigotConfig.hangingTickFrequency; } // Paper +@@ -41,6 +41,7 @@ public abstract class HangingEntity extends Entity { + private int checkInterval; { this.checkInterval = this.getId() % this.level().spigotConfig.hangingTickFrequency; } // Paper public BlockPos pos; protected Direction direction; + public boolean tick = true; // Parchment protected HangingEntity(EntityType type, Level world) { super(type, world); -@@ -117,7 +118,7 @@ public abstract class HangingEntity extends Entity { +@@ -116,7 +117,7 @@ public abstract class HangingEntity extends Entity { @Override public void tick() { -- if (!this.level.isClientSide) { -+ if (tick && !this.level.isClientSide) { // Parchment - this.checkOutOfWorld(); - if (this.checkInterval++ == this.level.spigotConfig.hangingTickFrequency) { // Spigot +- if (!this.level().isClientSide) { ++ if (tick && !this.level().isClientSide) { // Parchment + this.checkBelowWorld(); + if (this.checkInterval++ == this.level().spigotConfig.hangingTickFrequency) { // Spigot this.checkInterval = 0; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java index 62e11bf104b8d39ac73883e2a5d207e5f7393253..639bd33ae91ed818bda29fed776adb8c169458d7 100644 diff --git a/patches/server/0015-Add-Player-getHiddenEntities-API.patch b/patches/server/0015-Add-Player-getHiddenEntities-API.patch index 9e2fdfa..99488af 100644 --- a/patches/server/0015-Add-Player-getHiddenEntities-API.patch +++ b/patches/server/0015-Add-Player-getHiddenEntities-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getHiddenEntities API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0ae1fce0c1a2e3bfbbab756a088fc76545e263fa..4d768316f40fe6f239a8b75820d16ab8018f28f6 100644 +index 5bbded65095dccfadaf7576fc41b5f62974878b4..ece3637304863c8441c153e06ea9934cc91ff961 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1903,6 +1903,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1972,6 +1972,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper } // Paper start diff --git a/patches/server/0018-Expanded-Insomnia-API.patch b/patches/server/0018-Expanded-Insomnia-API.patch index f6d10d4..562f390 100644 --- a/patches/server/0018-Expanded-Insomnia-API.patch +++ b/patches/server/0018-Expanded-Insomnia-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4d768316f40fe6f239a8b75820d16ab8018f28f6..a3d3051b82b512c855fd87681a54817c32727b95 100644 +index ece3637304863c8441c153e06ea9934cc91ff961..af23e113aea3112b618d3fc9b0c9baf59a693025 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -76,6 +76,7 @@ import net.minecraft.server.network.ServerGamePacketListenerImpl; +@@ -81,6 +81,7 @@ import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.server.players.UserWhiteListEntry; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.Entity; @@ -16,7 +16,7 @@ index 4d768316f40fe6f239a8b75820d16ab8018f28f6..a3d3051b82b512c855fd87681a54817c import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeMap; import net.minecraft.world.entity.ai.attributes.Attributes; -@@ -179,6 +180,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -196,6 +197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit private long lastSaveTime; // Paper end @@ -24,14 +24,14 @@ index 4d768316f40fe6f239a8b75820d16ab8018f28f6..a3d3051b82b512c855fd87681a54817c public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2017,6 +2019,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2092,6 +2094,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this; } + // Parchment start + @Override + public boolean isInsomniac() { -+ return EntitySelector.isInsomniac.test(this.getHandle()); ++ return EntitySelector.IS_INSOMNIAC.test(this.getHandle()); + } + + @Override diff --git a/patches/server/0019-Add-spam-bypass-permission.patch b/patches/server/0019-Add-spam-bypass-permission.patch index 7e6c558..598c55b 100644 --- a/patches/server/0019-Add-spam-bypass-permission.patch +++ b/patches/server/0019-Add-spam-bypass-permission.patch @@ -5,31 +5,26 @@ Subject: [PATCH] Add spam bypass permission diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2d8488b9aa088b6d5f0c7e557b8ad0b29bc4cd88..64848434496e4897b696f975c330756befa1e9b4 100644 +index 75bd92e1d40588d3bc40fa7837943eec9f2062a6..66e5fc6e704ec3f859ed2172acef0a9e83fa39c2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -865,16 +865,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -884,6 +884,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { - // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async + // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async // CraftBukkit start + if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause return; - } - // Paper start -- String str = packet.getCommand(); int index = -1; -+ String str = packet.getCommand(); -+ int index = -1; - if (str.length() > 64 && ((index = str.indexOf(' ')) == -1 || index >= 64)) { - server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause +@@ -894,6 +895,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper return; } + } // Parchment - spam bypass // Paper end // CraftBukkit end // Paper start - Don't suggest if tab-complete is disabled -@@ -2547,6 +2550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2562,6 +2564,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Spigot start - spam exclusions private void detectRateSpam(String s) { @@ -37,16 +32,16 @@ index 2d8488b9aa088b6d5f0c7e557b8ad0b29bc4cd88..64848434496e4897b696f975c330756b // CraftBukkit start - replaced with thread safe throttle boolean counted = true; for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions ) -@@ -3268,10 +3272,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { +@@ -3294,10 +3297,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper start if (!org.bukkit.Bukkit.isPrimaryThread()) { + if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass - if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { - server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause + if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { + this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause return; } + } // Parchment - spam bypass } // Paper end - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0020-Disable-set-respawn-message.patch b/patches/server/0020-Disable-set-respawn-message.patch index 90f93a6..a85c413 100644 --- a/patches/server/0020-Disable-set-respawn-message.patch +++ b/patches/server/0020-Disable-set-respawn-message.patch @@ -5,21 +5,18 @@ Subject: [PATCH] Disable set respawn message diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index cbcc4141c904360127780d6441a960842e661ef0..0abb7d69f534089b06d7221327a9be282bb6006c 100644 +index 2abe06cb5de5ac63c31c1a120a3239aca07557f8..2eae1123cc24ad49248a8668701aa7015cbc4840 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2220,10 +2220,10 @@ public class ServerPlayer extends Player { - angle = (float) event.getLocation().getYaw(); +@@ -2279,9 +2279,11 @@ public class ServerPlayer extends Player { forced = event.isForced(); // Paper end -- -- if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper -- this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper -- } -+ // Parchment -+// if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper -+// this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper -+// } + ++ /* Parchment start + if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper + this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper + } ++ Parchment end */ this.respawnPosition = pos; this.respawnDimension = dimension; diff --git a/patches/server/0023-Remove-Hanging-Entity-Debug.patch b/patches/server/0022-Remove-Hanging-Entity-Debug.patch similarity index 85% rename from patches/server/0023-Remove-Hanging-Entity-Debug.patch rename to patches/server/0022-Remove-Hanging-Entity-Debug.patch index 9acb89c..a07aae5 100644 --- a/patches/server/0023-Remove-Hanging-Entity-Debug.patch +++ b/patches/server/0022-Remove-Hanging-Entity-Debug.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove Hanging Entity Debug diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java -index a22139bd4202237eb6977b95786b9a3647821874..47e93f5a3e9f8a71a121be0309e1307b1241bcf7 100644 +index 360ca6458083fa4018f11fcdade3ce930835db72..94f105c829d196c1526c8251527fe519a5e0180e 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java -@@ -273,7 +273,7 @@ public abstract class HangingEntity extends Entity { +@@ -272,7 +272,7 @@ public abstract class HangingEntity extends Entity { BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ")); if (!blockposition.closerThan(this.blockPosition(), 16.0D)) { diff --git a/patches/server/0022-Remove-Unneeded-Override.patch b/patches/server/0022-Remove-Unneeded-Override.patch deleted file mode 100644 index b82631f..0000000 --- a/patches/server/0022-Remove-Unneeded-Override.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Blast-Mc -Date: Mon, 9 Jan 2023 19:21:16 -0500 -Subject: [PATCH] Remove Unneeded Override - - -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 206bc729f24f679bed3b945b640778873699676a..e035ee2e499c6322c08ce6aa14fdebe134777fa2 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1736,7 +1736,6 @@ public class ServerLevel extends Level implements WorldGenLevel { - // Parchment end - } - -- @Override - public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) { - // Parchment start - sound event - CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent( diff --git a/patches/server/0024-Add-PreEntityShootBowEvent.patch b/patches/server/0023-Add-PreEntityShootBowEvent.patch similarity index 75% rename from patches/server/0024-Add-PreEntityShootBowEvent.patch rename to patches/server/0023-Add-PreEntityShootBowEvent.patch index ac2133f..61ae3c6 100644 --- a/patches/server/0024-Add-PreEntityShootBowEvent.patch +++ b/patches/server/0023-Add-PreEntityShootBowEvent.patch @@ -5,145 +5,145 @@ Subject: [PATCH] Add PreEntityShootBowEvent diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index f2094c52196b45adfd51d8aebcc4c46b779b0925..0498d3d0cee58e10351bd8c4ce7b9a3dbc862d09 100644 +index 9ca1e9d95e62929c0015d5ca2c2f9c70e421842e..36c55a63cc44724e377d8505321bca75bb4b2cea 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -199,13 +199,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -199,13 +199,17 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @Override public void performRangedAttack(LivingEntity target, float pullProgress) { ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW))); -+ ++ // Parchment start + gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy()); -+ if (!preEvent.callEvent()) { -+ return; -+ } -+ ++ if (!preEvent.callEvent()) return; ++ // Parchment end AbstractArrow entityarrow = this.getArrow(itemstack, pullProgress); double d0 = target.getX() - this.getX(); double d1 = target.getY(0.3333333333333333D) - entityarrow.getY(); double d2 = target.getZ() - this.getZ(); double d3 = Math.sqrt(d0 * d0 + d2 * d2); -- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4)); -+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4), preEvent.isRelative()); +- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4)); ++ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment // CraftBukkit start org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java -index 10573602c9bc73713cbd6989762d3dbb6f6fcf8c..b65c31bc257e362247855faabf49aec6347cec86 100644 +index 63fce7e3d9f59f36e29bc827a46396d73143bb8b..9762a79c928d7235a7868b37858474e1b1e0cf56 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java +++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java -@@ -189,13 +189,19 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { +@@ -189,13 +189,17 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { @Override public void performRangedAttack(LivingEntity target, float pullProgress) { ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW))); -+ ++ // Parchment start + gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy()); -+ if (!preEvent.callEvent()) { -+ return; -+ } -+ ++ if (!preEvent.callEvent()) return; ++ // Parchment end AbstractArrow entityarrow = ProjectileUtil.getMobArrow(this, itemstack, pullProgress); double d0 = target.getX() - this.getX(); double d1 = target.getY(0.3333333333333333D) - entityarrow.getY(); double d2 = target.getZ() - this.getZ(); double d3 = Math.sqrt(d0 * d0 + d2 * d2); -- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4)); -+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4), preEvent.isRelative()); +- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4)); ++ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment // Paper start org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, target.getUsedItemHand(), 0.8F, true); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..e43357fd32866c340bf8a8cfe415529941512f22 100644 +index 7226be19248a1ffb8ff2c89b55882529d33a6c0c..d960c55a28222066b6898d85d9588c8a1f0f9cc1 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -129,8 +129,8 @@ public abstract class AbstractArrow extends Projectile { +@@ -129,8 +129,10 @@ public abstract class AbstractArrow extends Projectile { } @Override - public void shoot(double x, double y, double z, float speed, float divergence) { - super.shoot(x, y, z, speed, divergence); ++ // Parchment start + public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) { + super.shoot(x, y, z, speed, divergence, relative); ++ // Parchment end this.life = 0; } 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 8b2a3a8482018b7db7de81bc295862f783e17ce5..bab146d88cf52e44087868a06ccdfcee67adf2b9 100644 +index 1b7cf6d06bdf36f146656727511a461f2520762e..8389b75b7534eedebe97dd975729039678b64c1e 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -145,9 +145,15 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -157,9 +157,17 @@ public abstract class Projectile extends Entity implements TraceableEntity { } public void shoot(double x, double y, double z, float speed, float divergence) { ++ // Parchment start + shoot(x, y, z, speed, divergence, true); + } + + public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) { ++ // Parchment end Vec3 vec3d = (new Vec3(x, y, z)).normalize().add(this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence)).scale((double) speed); -- this.setDeltaMovement(vec3d); -+ if (relative) { -+ this.setDeltaMovement(vec3d); -+ } ++ if (relative) { // Parchment + this.setDeltaMovement(vec3d); ++ } // Parchment double d3 = vec3d.horizontalDistance(); this.setYRot((float) (Mth.atan2(vec3d.x, vec3d.z) * 57.2957763671875D)); -@@ -157,6 +163,10 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -169,6 +177,12 @@ public abstract class Projectile extends Entity implements TraceableEntity { } public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) { -+ this.shootFromRotation(shooter, pitch, yaw, roll, speed, divergence, true); ++ // Parchment start ++ shootFromRotation(shooter, pitch, yaw, roll, speed, divergence, true); + } + + public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence, boolean relative) { ++ // Parchment end float f5 = -Mth.sin(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F); float f6 = -Mth.sin((pitch + roll) * 0.017453292F); float f7 = Mth.cos(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F); -@@ -164,7 +174,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -176,7 +190,9 @@ public abstract class Projectile extends Entity implements TraceableEntity { this.shoot((double) f5, (double) f6, (double) f7, speed, divergence); Vec3 vec3d = shooter.getDeltaMovement(); -- if (!shooter.level.paperConfig().misc.disableRelativeProjectileVelocity) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.isOnGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity -+ if (!shooter.level.paperConfig().misc.disableRelativeProjectileVelocity && relative) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.isOnGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity ++ if (relative) { // Parchment + if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity ++ } // Parchment } // CraftBukkit start - call projectile hit event diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java -index 08d597db1a5345a343777a01427655e6bf2c926b..c047a2cf20a3f02b2d4a2fb71306234ccfa84429 100644 +index 08d597db1a5345a343777a01427655e6bf2c926b..b923ea037a69628309167d16cc2a0ae780444523 100644 --- a/src/main/java/net/minecraft/world/item/BowItem.java +++ b/src/main/java/net/minecraft/world/item/BowItem.java -@@ -42,9 +42,15 @@ public class BowItem extends ProjectileWeaponItem implements Vanishable { +@@ -42,9 +42,13 @@ public class BowItem extends ProjectileWeaponItem implements Vanishable { if (!world.isClientSide) { ArrowItem itemarrow = (ArrowItem) (itemstack1.getItem() instanceof ArrowItem ? itemstack1.getItem() : Items.ARROW); -+ ++ // Parchment start + gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(entityhuman.getBukkitEntity(), stack.asBukkitCopy(), itemstack1.asBukkitCopy()); -+ if (!preEvent.callEvent()) { -+ return; -+ } -+ ++ if (!preEvent.callEvent()) return; ++ // Parchment end AbstractArrow entityarrow = itemarrow.createArrow(world, itemstack1, entityhuman); - entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F); -+ entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F, preEvent.isRelative()); ++ entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F, preEvent.isRelative()); // Parchment if (f == 1.0F) { entityarrow.setCritArrow(true); } diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index bc4f04c2512191da3c9e1c49f0716bb9128fc754..27276ee045cb0475dcbd47130d943fcaf597d119 100644 +index eede02c3f125d230af537bb67bebed9b88f7d1b4..343c634b97f3ff5e8eda008121a661423a1810aa 100644 --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java -@@ -228,6 +228,11 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { +@@ -225,6 +225,11 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { private static void shootProjectile(Level world, LivingEntity shooter, InteractionHand hand, ItemStack crossbow, ItemStack projectile, float soundPitch, boolean creative, float speed, float divergence, float simulated) { if (!world.isClientSide) { ++ // Parchment start + gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(shooter.getBukkitEntity(), crossbow.asBukkitCopy(), projectile.asBukkitCopy()); -+ if (!preEvent.callEvent()) { -+ return; -+ } -+ ++ if (!preEvent.callEvent()) return; ++ // TODO: handle relative flag in CrossbowAttackMob#shootCrossbowProjectile ++ // Parchment end boolean flag1 = projectile.is(Items.FIREWORK_ROCKET); Object object; diff --git a/patches/server/0024-Return-Displays-in-getTargetEntity.patch b/patches/server/0024-Return-Displays-in-getTargetEntity.patch new file mode 100644 index 0000000..75cac30 --- /dev/null +++ b/patches/server/0024-Return-Displays-in-getTargetEntity.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Blast-MC +Date: Sun, 19 Mar 2023 20:02:00 -0400 +Subject: [PATCH] Return Displays in getTargetEntity + + +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index e11d7283662834047b2ff81a2fd25a4263792deb..e170773b922c4b3970d0914f5e8cf26d419c0ffd 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -4036,7 +4036,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + Vec3 direction = this.getLookAngle(); + Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance); + +- List entityList = this.level().getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(Entity::isPickable)); ++ List entityList = this.level().getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display)); // Parchment - add displays + + double distance = 0.0D; + EntityHitResult result = null; diff --git a/patches/server/0026-Make-SynchedEntityData-packAll-Public.patch b/patches/server/0025-Make-SynchedEntityData-packAll-Public.patch similarity index 85% rename from patches/server/0026-Make-SynchedEntityData-packAll-Public.patch rename to patches/server/0025-Make-SynchedEntityData-packAll-Public.patch index d9de5d8..0cc3e85 100644 --- a/patches/server/0026-Make-SynchedEntityData-packAll-Public.patch +++ b/patches/server/0025-Make-SynchedEntityData-packAll-Public.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make SynchedEntityData#packAll Public diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java -index ff7ba7a161cfed7521354bc6e3f21ba0f17f3760..8d17e503894858b9e195d70a74513dee60aa3ec3 100644 +index 5dfb35117c285e0b202dc9c088ad5848beb8d054..662e20a607c348403250f50a8ff0a0171e128701 100644 --- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java +++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java -@@ -263,7 +263,7 @@ public class SynchedEntityData { +@@ -289,7 +289,7 @@ public class SynchedEntityData { // We need to pack all as we cannot rely on "non default values" or "dirty" ones. // Because these values can possibly be desynced on the client. @Nullable diff --git a/patches/server/0025-Return-Displays-in-getTargetEntity.patch b/patches/server/0025-Return-Displays-in-getTargetEntity.patch deleted file mode 100644 index 2d87532..0000000 --- a/patches/server/0025-Return-Displays-in-getTargetEntity.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Blast-MC -Date: Sun, 19 Mar 2023 20:02:00 -0400 -Subject: [PATCH] Return Displays in getTargetEntity - - -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index dcfb71b5a53df789e366fea2080921d677549a2e..755ae62d64c15358b2f88ab6471c9046ced74a66 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3988,7 +3988,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - Vec3 direction = this.getLookAngle(); - Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance); - -- List entityList = level.getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(Entity::isPickable)); -+ List entityList = level.getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display)); - - double distance = 0.0D; - EntityHitResult result = null;