High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies https://papermc.io/
Find a file
Bjarne Koll 9b149d34f9
Properly remove overriding potion effect modifiers
As of minecraft 1.15.2's first pre-release potion effects no longer
completely replace weaker once of the same potion effect type but rather
build a list of overriding potion effects to preserve and eventually
re-apply weaker potion effects that last longer than more powerful but
more shortlived overriding potion effects of the same type.

This replacement of such overriding potion effects simply removes the
attribute modifier added by the potion effect based on a single uuid
defined by each potion effect type.
After the removal, a new attribute modified is added that holds the
updated modifications based on the lower amplifier of the weaker potion
effect.
As the removal of the stronger potion effect is purely based on the
single uuid of each individual potion effect type the amplifier of the
old effect is not needed to properly remove the effect and is sadly not
passed to the removal logic in the first place.

This however fails for the absorption potion effect type, as it cannot
make use of the attribute modifier system and the single uuid concept
used by other potion effect types.
Hence, prior to this commit, it simply calculates the amount of
absorption hearts granted by the amplifier of the potion effect and
removes these.
As the server however only provides the amplifier (more specifically the
new potion effect) to the update method once an overriding absorption
effect is replaced, the removal only removes the amount of absorption
hearts.

This patch combats this faulty behaviour by now properly passing the old
and new mob effect (and their respective amplifier) through the update
logic of the living entity and mob effects.
While this prevents the absorption effect from leaving the player with
absorption hearts after the effect completely expires, it did allow the
effect to re-generate absorption hearts that were lost due to damage
when replacing the overriding effect with the lower potion effect.

The patch introduces MobEffect#updateAttributeModifiers which is
responsible for performing the previously described logic of removing
and applying attribute modifiers.
This method is then leveraged by the absorption mob effect to correctly
calculate the difference between the old and new amplifiers.

Resolves: https://bugs.mojang.com/browse/MC-182497
2022-06-12 01:23:33 +02:00
.github Update actions 2022-04-05 10:44:21 -07:00
build-data Fix more issues 2022-06-07 20:59:40 -07:00
gradle/wrapper Update Gradle wrapper 2022-04-05 10:37:45 -07:00
licenses [CI-SKIP] Clarify project licensing 2018-03-06 20:41:03 -05:00
Paper-MojangAPI Replace third party repos with Paper repo (#7733) 2022-04-13 19:58:48 -07:00
patches Properly remove overriding potion effect modifiers 2022-06-12 01:23:33 +02:00
scripts Updated Upstream (Bukkit/CraftBukkit) (#7604) 2022-03-16 16:57:51 +01:00
test-plugin Don't send itemmeta for books with the hide option enabled (#7734) 2022-04-18 12:23:37 +02:00
work Updated Upstream (Bukkit/CraftBukkit) (#7936) 2022-06-11 11:02:57 +02:00
.editorconfig Move to configurate for paper.yml (#7609) 2022-06-09 10:51:45 +02:00
.gitattributes Fix patch, fix .gitattributes file name 2021-06-12 14:09:11 +02:00
.gitignore [ci skip] Add a test plugin (#6133) 2021-07-09 03:04:33 -07:00
.gitmodules Remove Paperclip submodule 2021-06-15 01:44:13 -05:00
build.gradle.kts Prepare for 1.19 dev 2022-06-07 18:52:56 +02:00
CONTRIBUTING.md [ci skip] Changing the order of the rebase with autosquash command in the contributing.md (#6974) 2022-06-03 16:34:54 +01:00
gradle.properties More more patches 2022-06-07 21:55:39 +02:00
gradlew [ci skip] Bump paperweight to 1.1.11, update Gradle wrapper script (#6421) 2021-08-18 13:34:52 -05:00
gradlew.bat gradlew.bat crlf fix (#5810) 2021-06-12 22:34:05 +01:00
LICENSE.md Add configurable height for slime spawn per world (#6310) 2022-01-10 18:27:16 -08:00
README.md More compilation error fixes 2022-06-08 16:24:55 +02:00
settings.gradle.kts [ci-skip] Update repository and API urls (#7835) 2022-05-20 08:12:30 -07:00
todo.txt Add dropped hunk from mid-tick tasks (#7034) 2021-12-05 13:58:01 -08:00

Paper Paper Build Status Discord GitHub Sponsors Open Collective

High performance Spigot fork 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)

  • See our API patches here
  • See upcoming, pending, and recently added API here
  • Paper API javadocs here: papermc.io/javadocs
  • Maven Repo (for paper-api):
<repository>
    <id>papermc</id>
    <url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
  • Artifact Information:
<dependency>
    <groupId>io.papermc.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>1.19-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
</dependency>

Or alternatively, with Gradle:

  • Repository:
repositories {
    maven {
        url = uri("https://repo.papermc.io/repository/maven-public/")
    }
}

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

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

How To (Compiling Jar From Source)

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

Clone this repo, run ./gradlew applyPatches, then ./gradlew createReobfBundlerJar 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 finanically 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