3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00
Datei suchen
Bjarne Koll 7ae2c671c6
Keep components using single items in creative (#10664)
The craftbukkit implementation stores the old and new data patch of an
item during ItemStack#useOn(UseOnContext) to properly cancel events via
comparison and change detection of the component patch.

However, it uses #getComponentsPatch to fetch the new stack component
patch, which always yields an empty patch set if an itemstack is
considered empty by the game.
As the restoration of an itemstack's count to its previous state is
handled after the entire ItemStack#useOn method, items used in creative
mode temporarily have a count of zero, which causes craftbukkit to
consider their new component patch as EMPTY even tho said item may have
data.
The new patch is applied and, after useOn completes, the count is reset
if the player is in creative mode, leading to lost data.

This commit fixes said inconsistency by directly accessing the
components of the item via components#asPatch, storing the proper
component patch even for an item that temporarily has a count of zero.
2024-05-05 11:40:36 +02:00
.github [ci skip] Remove trailing comma in projects action 2024-04-30 15:56:43 +02:00
build-data build: Update paperweight to 1.5.12 and Gradle Wrapper to 8.7 (#10361) 2024-03-29 10:43:36 -07:00
gradle/wrapper build: Update paperweight to 1.5.12 and Gradle Wrapper to 8.7 (#10361) 2024-03-29 10:43:36 -07:00
licenses [ci skip] add missing final newline (#8659) 2022-12-13 14:16:45 +01:00
paper-api-generator add RegistryAccess for managing registries (#10154) 2024-05-04 11:22:35 -07:00
Paper-MojangAPI Updated Upstream (Bukkit/CraftBukkit) (#10379) 2024-04-06 12:53:39 -07:00
patches Keep components using single items in creative (#10664) 2024-05-05 11:40:36 +02:00
removed-patches-1-20-5 proper migration to gamerules for keep spawn loaded distance 2024-04-27 15:50:38 -07:00
scripts Remove patch renaming scripts 2024-04-25 10:53:29 -07:00
test-plugin more fixes for ItemMeta relating to components 2024-04-27 22:27:51 -07:00
work Updated Upstream (CraftBukkit) (#10624) 2024-04-30 16:53:54 -07:00
.editorconfig Code Generation for TypedKeys (#9233) 2023-11-22 20:56:28 -08:00
.gitattributes [ci skip] update editorconfig and gitattributes (#9608) 2023-08-22 12:16:03 +10:00
.gitignore update generator 2024-04-27 22:32:16 +02:00
.gitmodules Update adventure 2023-12-06 21:24:16 -07:00
build.gradle.kts Update paperweight to 1.6.3 (#10626) 2024-04-30 10:30:14 -07:00
CONTRIBUTING.md Update Java version references, add note on var usages 2024-05-01 18:44:39 +02:00
gradle.properties 1.20.6 (#10623) 2024-04-30 00:16:07 +02:00
gradlew Update paperweight to 1.5.10 and Gradle to 8.4 (#9957) 2023-11-22 06:27:50 +01:00
gradlew.bat build: Update paperweight to 1.5.12 and Gradle Wrapper to 8.7 (#10361) 2024-03-29 10:43:36 -07:00
LICENSE.md check if itemstack is stackable first (#10285) 2024-03-03 10:37:00 -08:00
README.md 1.20.6 (#10623) 2024-04-30 00:16:07 +02:00
settings.gradle.kts build: Update paperweight to 1.5.12 and Gradle Wrapper to 8.7 (#10361) 2024-03-29 10:43:36 -07:00

Paper Paper Build Status Discord GitHub Sponsors Open Collective

The most widely used, high-performance Minecraft server that aims to fix gameplay and mechanics inconsistencies.

Support and Project Discussion:

How To (Server Admins)

Paperclip is a jar file that you can download and run just like a normal jar file.

Download Paper from our downloads page.

Run the Paperclip jar directly from your server. Just like old times

How To (Plugin Developers)

Repository (for paper-api)

Maven
<repository>
    <id>papermc</id>
    <url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<dependency>
    <groupId>io.papermc.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>1.20.6-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>
Gradle
repositories {
    maven {
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}

How To (Compiling Jar From Source)

To compile Paper, you need JDK 21 and an internet connection.

Clone this repo, run ./gradlew applyPatches, then ./gradlew createMojmapBundlerJar from your terminal. You can find the compiled jar in the project root's build/libs directory.

To get a full list of tasks, run ./gradlew tasks.

How To (Pull Request)

See Contributing

Support Us

First of all, thank you for considering helping out, we really appreciate that!

PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses Open Collective via the Open Source Collective fiscal host to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about financially supporting PaperMC on our website.

You can find our collective here, or you can donate via GitHub Sponsors here, which will also go towards the collective.

Special Thanks To:

YourKit-Logo

YourKit, makers of the outstanding java profiler, support open source projects of all kinds with their full featured Java and .NET application profilers. We thank them for granting Paper an OSS license so that we can make our software the best it can be.

JetBrains, creators of the IntelliJ IDEA, supports Paper with one of their Open Source Licenses. IntelliJ IDEA is the recommended IDE for working with Paper, and most of the Paper team uses it.

All our sponsors!
Sponsor Image