From e224056a295af40878ae912e79f5a326792adf2c Mon Sep 17 00:00:00 2001 From: Blast-MC Date: Sat, 15 Feb 2025 01:22:45 -0500 Subject: [PATCH] update upstream (and fix a few bugs) --- .github/workflows/build.yml | 64 +++++++++++++------ README.md | 11 ++-- build.gradle.kts | 7 +- gradle.properties | 2 +- parchment-api/build.gradle.kts.patch | 9 +++ .../main/java/org/bukkit/Location.java.patch | 2 +- .../java/org/bukkit/OfflinePlayer.java.patch | 4 +- .../src/main/java/org/bukkit/World.java.patch | 2 +- .../java/org/bukkit/block/Block.java.patch | 2 +- .../org/bukkit/entity/HumanEntity.java.patch | 6 +- .../java/org/bukkit/entity/Player.java.patch | 27 ++++---- parchment-server/build.gradle.kts.patch | 25 ++++---- .../ServerGamePacketListenerImpl.java.patch | 6 +- .../minecraft/world/entity/Entity.java.patch | 2 +- .../world/entity/player/Player.java.patch | 2 +- .../entity/projectile/Projectile.java.patch | 20 +++--- .../world/level/block/Block.java.patch | 3 +- .../bukkit/craftbukkit/CraftWorld.java.patch | 2 +- .../org/bukkit/craftbukkit/Main.java.patch | 10 +-- .../craftbukkit/entity/CraftPlayer.java.patch | 16 ++--- .../event/CraftEventFactory.java.patch | 2 +- .../resources/data/.paperassetsroot.patch | 3 - 22 files changed, 124 insertions(+), 103 deletions(-) delete mode 100644 parchment-server/paper-patches/files/src/main/resources/data/.paperassetsroot.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4434243..32b50c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,50 @@ -name: Patch and Build +name: Build main -on: - push: - branches: [ "**" ] - pull_request: +on: [push] jobs: build: - # Only run on PRs if the source branch is on someone else's repo - if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + + strategy: + matrix: + java: [21] + fail-fast: true + steps: - - name: Checkout Git Repository - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v4 + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '21' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Configure Git User Details - run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions" - - name: Apply Patches - run: ./gradlew applyAllPatches --stacktrace - - name: Build - run: ./gradlew build + java-version: ${{ matrix.java }} + distribution: 'adopt' + + - name: Cache gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/jdks + ~/.gradle/native + ~/.gradle/wrapper + key: ${{ runner.os }}-parchment-2-${{ hashFiles('**/*.gradle*', 'gradle/**', 'gradle.properties') }} + restore-keys: ${{ runner.os }}-parchment-2 + + - name: Patch Parchment + env: + ORG_GRADLE_PROJECT_edenSnapshotsUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_edenSnapshotsPassword: ${{ secrets.SONATYPE_PASSWORD }} + run: | + git config --global user.email "no-reply@github.com" + git config --global user.name "GitHub Actions" + ./gradlew applyAllPatches + ./gradlew createMojmapPaperclipJar + ./gradlew :parchment-api:publishMavenPublicationToEdenSnapshotsRepository + ./gradlew publishDevBundlePublicationToEdenSnapshotsRepository -PpublishDevBundle + + - uses: actions/upload-artifact@v3 + with: + name: Parchment-JDK${{ matrix.java }} + path: parchment-server/build/libs/parchment-paperclip-*-mojmap.jar \ No newline at end of file diff --git a/README.md b/README.md index f94f633..6583bc4 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,11 @@ Things I've found while just trying to get this to work: - If you've made an update to either of the build.gradle.kts files in api or server, run `./gradlew rebuildPaperSingleFilePatches` after adding to git (no commit) - To create a file patch: - Make the changes you need and have no other staged changes - - cd paper-api or paper-server + - cd **paper-api** or **paper-server** or **parchment-server/src/minecraft/java** - git add . - - git commit --ammend - - This ammends it to the specific 'File Patch Commit' - - ./gradlew rebuildPaperFilePatches \ No newline at end of file + - git commit --amend + - This ammends it to the specific 'File Patch Commit' + - Then run one of the following + - ./gradlew rebuildPaperApiFilePatches + - ./gradlew rebuildPaperServerFilePatches + - ./gradlew rebuildMinecraftFilePatches \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 71efa04..45a6287 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { java // TODO java launcher tasks - id("io.papermc.paperweight.patcher") version "2.0.0-beta.13" + id("io.papermc.paperweight.patcher") version "2.0.0-beta.14" } paperweight { @@ -26,11 +26,6 @@ paperweight { patchesDir = file("parchment-api/paper-patches") outputDir = file("paper-api") } - patchDir("paperApiGenerator") { - upstreamPath = "paper-api-generator" - patchesDir = file("parchment-api-generator/paper-patches") - outputDir = file("paper-api-generator") - } } } diff --git a/gradle.properties b/gradle.properties index a836af1..b98ea3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group=gg.projecteden.parchment version=1.21.4-R0.1-SNAPSHOT mcVersion=1.21.4 -paperRef=b03d39b5ce6b5046ce6854ddba74e8ae3641c230 +paperRef=6cfa2f7f315cbad23d7b12984b751f2721b496b6 org.gradle.configuration-cache=true org.gradle.caching=true diff --git a/parchment-api/build.gradle.kts.patch b/parchment-api/build.gradle.kts.patch index 5812932..d34f8c0 100644 --- a/parchment-api/build.gradle.kts.patch +++ b/parchment-api/build.gradle.kts.patch @@ -17,6 +17,15 @@ // api dependencies are listed transitively to API consumers api("com.google.guava:guava:33.3.1-jre") +@@ -93,7 +_,7 @@ + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + } + +-val generatedApiPath: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath() ++val generatedApiPath: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-api/src/generated/java").asFile.toPath() + idea { + module { + generatedSourceDirs.add(generatedApiPath.toFile()) @@ -103,6 +_,18 @@ main { java { diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/Location.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/Location.java.patch index 72daf26..f40ae83 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/Location.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/Location.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -27,13 +_,20 @@ +@@ -28,13 +_,20 @@ * magnitude than 360 are valid, but may be normalized to any other equivalent * representation by the implementation. */ diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/OfflinePlayer.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/OfflinePlayer.java.patch index 26fd9e1..3044237 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/OfflinePlayer.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/OfflinePlayer.java.patch @@ -1,9 +1,9 @@ --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -19,7 +_,14 @@ - * player that is stored on the disk and can, thus, be retrieved without the +@@ -20,7 +_,14 @@ * player needing to be online. */ + @NullMarked -public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder { // Paper - Add Offline PDC API +public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable, io.papermc.paper.persistence.PersistentDataViewHolder, gg.projecteden.parchment.HasOfflinePlayer, gg.projecteden.parchment.OptionalPlayer { // Parchment + diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch index b982c26..bdebd7f 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/World.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -52,6 +_,36 @@ +@@ -53,6 +_,36 @@ */ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/block/Block.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/block/Block.java.patch index 9b5ac65..e31118e 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/block/Block.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/block/Block.java.patch @@ -9,7 +9,7 @@ /** * Gets the metadata for this block -@@ -593,6 +_,20 @@ +@@ -590,6 +_,20 @@ * @return true if the block was destroyed */ boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience); diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/HumanEntity.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/HumanEntity.java.patch index 904e98e..5799eaa 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/HumanEntity.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/HumanEntity.java.patch @@ -1,15 +1,15 @@ --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -23,7 +_,14 @@ - /** +@@ -25,7 +_,14 @@ * Represents a human entity, such as an NPC or a player */ + @NullMarked -public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder { +public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder, gg.projecteden.parchment.HasHumanEntity { // Parchment + + // Parchment start + @Override -+ default @NotNull HumanEntity getPlayer() { ++ default HumanEntity getPlayer() { + return this; + } + // Parchment end diff --git a/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/Player.java.patch b/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/Player.java.patch index 84c7f6b..85a1e27 100644 --- a/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/Player.java.patch +++ b/parchment-api/paper-patches/files/src/main/java/org/bukkit/entity/Player.java.patch @@ -1,11 +1,11 @@ --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -59,7 +_,17 @@ - /** +@@ -62,7 +_,17 @@ * Represents a player, connected or not */ + @NullMarked -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 ++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 + /** @@ -14,14 +14,14 @@ + * @return this player + */ + @Override -+ @NotNull Player getPlayer(); ++ Player getPlayer(); + // Parchment end // Paper start @Override -@@ -2128,6 +_,17 @@ +@@ -2084,6 +_,16 @@ */ - public boolean canSee(@NotNull Entity entity); + public boolean canSee(Player player); + // Parchment start + /** @@ -30,17 +30,16 @@ + * @param plugin Plugin that has hidden entities + * @return a view of hidden entity UUIDs + */ -+ public java.util.@NotNull Set getHiddenEntities(@NotNull Plugin plugin); ++ public java.util.Set getHiddenEntities(Plugin plugin); + // Parchment end + -+ - // Paper start /** - * Returns whether the {@code other} player is listed for {@code this}. -@@ -3892,4 +_,45 @@ + * Visually hides an entity from this player. + * +@@ -3902,4 +_,43 @@ + * @return the result of this method, holding leftovers and spawned items. */ - void sendEntityEffect(org.bukkit.@NotNull EntityEffect effect, @NotNull Entity target); - // Paper end - entity effect API + PlayerGiveResult give(Collection items, boolean dropIfFull); + + /** + * Checks if the player will spawn phantoms at night @@ -80,6 +79,4 @@ + * @return ticks since the player last slept + */ + int getTimeSinceLastRest(); -+// Parchment end -+ } diff --git a/parchment-server/build.gradle.kts.patch b/parchment-server/build.gradle.kts.patch index dd04dc7..a253951 100644 --- a/parchment-server/build.gradle.kts.patch +++ b/parchment-server/build.gradle.kts.patch @@ -1,9 +1,10 @@ --- a/paper-server/build.gradle.kts +++ b/paper-server/build.gradle.kts -@@ -21,8 +_,19 @@ - // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") - // gitFilePatches = true - +@@ -37,6 +_,21 @@ + "org.bukkit.craftbukkit", + "org.spigotmc", + ) ++ + val fork = forks.register("parchment") { + upstream.patchDir("paperServer") { + upstreamPath = "paper-server" @@ -15,13 +16,13 @@ + + activeFork = fork + - paper { -- reobfMappingsPatch = layout.projectDirectory.file("../build-data/reobf-mappings-patch.tiny") ++ paper { + paperServerDir = upstreamsDirectory().map { it.dir("paper/paper-server") } - } ++ } + } - spigot { -@@ -105,7 +_,20 @@ + tasks.generateDevelopmentBundle { +@@ -101,7 +_,20 @@ } } @@ -43,16 +44,16 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) { extendsFrom(configurations.compileClasspath.get()) } -@@ -123,7 +_,7 @@ +@@ -119,7 +_,7 @@ } dependencies { - implementation(project(":paper-api")) + implementation(project(":parchment-api")) - implementation("ca.spottedleaf:concurrentutil:0.0.2") + implementation("ca.spottedleaf:concurrentutil:0.0.3") implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 -@@ -192,14 +_,14 @@ +@@ -188,14 +_,14 @@ val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", diff --git a/parchment-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/parchment-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 4b7b11d..53509e4 100644 --- a/parchment-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/parchment-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -778,9 +_,12 @@ +@@ -785,9 +_,12 @@ public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async // CraftBukkit start @@ -16,7 +16,7 @@ } // CraftBukkit end // Paper start - Don't suggest if tab-complete is disabled -@@ -2490,6 +_,7 @@ +@@ -2497,6 +_,7 @@ // Spigot start - spam exclusions private void detectRateSpam(String message) { @@ -24,7 +24,7 @@ // CraftBukkit start - replaced with thread safe throttle for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) { if (exclude != null && message.startsWith(exclude)) { -@@ -3245,9 +_,11 @@ +@@ -3280,9 +_,11 @@ public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { // Paper start - auto recipe limit if (!org.bukkit.Bukkit.isPrimaryThread()) { diff --git a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch index 259b8cd..8ca8c27 100644 --- a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch +++ b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -5081,4 +_,31 @@ +@@ -5077,4 +_,31 @@ return ((ServerLevel) this.level).isPositionEntityTicking(this.blockPosition()); } // Paper end - Expose entity id counter diff --git a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index 95c7c83..ef1b26d 100644 --- a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -36,7 +36,7 @@ } } // Paper end - send while respecting visibility -@@ -2432,4 +_,11 @@ +@@ -2440,4 +_,11 @@ return this.message; } } diff --git a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/Projectile.java.patch b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/Projectile.java.patch index 0009f75..1c9bd17 100644 --- a/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/Projectile.java.patch +++ b/parchment-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/Projectile.java.patch @@ -16,29 +16,27 @@ this.hasImpulse = true; double d = movementToShoot.horizontalDistance(); this.setYRot((float)(Mth.atan2(movementToShoot.x, movementToShoot.z) * 180.0F / (float)Math.PI)); -@@ -193,14 +_,19 @@ +@@ -193,6 +_,10 @@ } public void shootFromRotation(Entity shooter, float x, float y, float z, float velocity, float inaccuracy) { -+ // Parchment start -+ shootFromRotation(shooter, x, y, z, velocity, inaccuracy, true); ++ this.shootFromRotation(shooter, x, y, z, velocity, inaccuracy, true); + } + + public void shootFromRotation(Entity shooter, float x, float y, float z, float velocity, float inaccuracy, boolean relative) { float f = -Mth.sin(y * (float) (Math.PI / 180.0)) * Mth.cos(x * (float) (Math.PI / 180.0)); float f1 = -Mth.sin((x + z) * (float) (Math.PI / 180.0)); float f2 = Mth.cos(y * (float) (Math.PI / 180.0)) * Mth.cos(x * (float) (Math.PI / 180.0)); - this.shoot(f, f1, f2, velocity, inaccuracy); - Vec3 knownMovement = shooter.getKnownMovement(); - // Paper start - allow disabling relative velocity +@@ -202,7 +_,7 @@ + if (Double.isNaN(knownMovement.x) || Double.isNaN(knownMovement.y) || Double.isNaN(knownMovement.z)) { + knownMovement = new Vec3(0, 0, 0); + } - if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) { -- this.setDeltaMovement(this.getDeltaMovement().add(knownMovement.x, shooter.onGround() ? 0.0 : knownMovement.y, knownMovement.z)); + if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) { -+ this.setDeltaMovement(this.getDeltaMovement().add(knownMovement.x, shooter.onGround() ? 0.0 : knownMovement.y, knownMovement.z)); + this.setDeltaMovement(this.getDeltaMovement().add(knownMovement.x, shooter.onGround() ? 0.0 : knownMovement.y, knownMovement.z)); } // Paper end - allow disabling relative velocity - } -@@ -232,7 +_,11 @@ +@@ -235,7 +_,11 @@ float velocity, float inaccuracy ) { @@ -51,7 +49,7 @@ } public static T spawnProjectileUsingShoot( -@@ -241,9 +_,19 @@ +@@ -244,9 +_,19 @@ // Paper start - fixes and addition to spawn reason API return spawnProjectileUsingShootDelayed(projectile, level, spawnedFrom, x, y, z, velocity, inaccuracy).spawn(); } diff --git a/parchment-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch b/parchment-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch index c86aece..3d4818b 100644 --- a/parchment-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch +++ b/parchment-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -308,30 +_,46 @@ +@@ -308,30 +_,45 @@ } // Paper end - Add BlockBreakBlockEvent @@ -43,7 +43,6 @@ - getDrops(state, (ServerLevel)level, pos, blockEntity, entity, tool).forEach(itemStack -> popResource(level, pos, itemStack)); + List itemEntities = new java.util.ArrayList<>(); + org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(level, pos, Block.getDrops(state, (ServerLevel) level, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment -+ Block.popResource(level, pos, itemstack1); + itemEntities.add(Block.popResourceWithReturn(level, pos, itemstack1)); + }); state.spawnAfterBreak((ServerLevel) level, pos, tool, dropExperience); // Paper - Properly handle xp dropping diff --git a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch index 72ee61e..f44eaf2 100644 --- a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch +++ b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2472,4 +_,16 @@ +@@ -2498,4 +_,16 @@ return this.adventure$pointers; } // Paper end diff --git a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch index 675bcb0..e899d03 100644 --- a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch +++ b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/Main.java.patch @@ -1,11 +1,13 @@ --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -267,7 +_,7 @@ +@@ -266,8 +_,8 @@ + deadline.add(Calendar.DAY_OF_YEAR, -14); if (buildDate.before(deadline.getTime())) { // Paper start - This is some stupid bullshit - System.err.println("*** Warning, you've not updated in a while! ***"); -- System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads/paper ***"); // Paper -+ System.err.println("*** Please download a new build as per instructions from https://github.com/ProjectEdenGG/Parchment ***"); // Paper +- System.err.println("*** Warning, you've not updated in a while! ***"); +- System.err.println("*** Please download a new build from https://papermc.io/downloads/paper ***"); // Paper ++ // System.err.println("*** Warning, you've not updated in a while! ***"); ++ // System.err.println("*** Please download a new build from https://papermc.io/downloads/paper ***"); // Paper //System.err.println("*** Server will start in 20 seconds ***"); //Thread.sleep(TimeUnit.SECONDS.toMillis(20)); // Paper end diff --git a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch index 70be676..f1a1e51 100644 --- a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch +++ b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -219,6 +_,7 @@ +@@ -226,6 +_,7 @@ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API 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 - getLastPlayed replacement API @@ -8,11 +8,11 @@ public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -3541,4 +_,41 @@ - this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData())); +@@ -3583,4 +_,39 @@ + handle.containerMenu.broadcastChanges(); + return new PaperPlayerGiveResult(leftovers.build(), drops.build()); } - // Paper end - entity effect API -+ ++ + // Parchment start + @Override + public Set getHiddenEntities(Plugin plugin) { @@ -21,7 +21,7 @@ + .map(Map.Entry::getKey) + .collect(java.util.stream.Collectors.toSet()); + } -+ ++ + @Override + public boolean isInsomniac() { + return net.minecraft.world.entity.EntitySelector.IS_INSOMNIAC.test(this.getHandle()); @@ -46,7 +46,5 @@ + public int getTimeSinceLastRest() { + return net.minecraft.util.Mth.clamp(this.getHandle().getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE); + } -+ -+ // Parchment end -+ ++ } diff --git a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java.patch b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java.patch index 44a3696..62090ae 100644 --- a/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java.patch +++ b/parchment-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java.patch @@ -9,7 +9,7 @@ return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled); } -@@ -2271,4 +_,57 @@ +@@ -2272,4 +_,57 @@ return event; } // Paper end - add EntityFertilizeEggEvent diff --git a/parchment-server/paper-patches/files/src/main/resources/data/.paperassetsroot.patch b/parchment-server/paper-patches/files/src/main/resources/data/.paperassetsroot.patch deleted file mode 100644 index b41d58b..0000000 --- a/parchment-server/paper-patches/files/src/main/resources/data/.paperassetsroot.patch +++ /dev/null @@ -1,3 +0,0 @@ ---- a/src/main/resources/data/.paperassetsroot -+++ b/src/main/resources/data/.paperassetsroot -@@ -1,0 +_,0 @@