Remove itemstack mutation on player drop method
This appears to cause alot of issues, as the general assumption when calling this method is that the itemstack would not be mutated.
Common issues that this seems to cause is item related actions that later increment a statistic, which is no longer true because the item type changes since its now considered empty. The dupe that this was meant to resolve was patched.
Fixes #11520 Fixes #11765 Supercedes https://github.com/PaperMC/Paper/pull/11521
I have tried to look deeply into all of the changes that may be caused by this and I have seen the following, note that I would like a second opinion from some of these. Note that for analyizing these you must look at the parameter passed and ensure that the itemstack is either cloned or removed from the container properly before being called.
Some interesting calls:
- ResultSlot.onTake(Player, ItemStack) (net.minecraft.world.inventory) — This looks like where the above bug fix occurs?
- Inventory.placeItemBackInInventory(ItemStack, boolean) (net.minecraft.world.entity.player) — looked suspicious, altough is fine
- StonecutterMenu.quickMoveStack(Player, int) (net.minecraft.world.inventory) — This is sus, there is defo mutation in that slot occuring here. Do we cause another bug here?
- Bucketable.bucketMobPickup(Player, InteractionHand, T) (net.minecraft.world.entity.animal) — behavior change, bucketItemStack will now respect in advancement
- AbstractContainerMenu#614 -mutation affects outer loop
Also fixes the item drop statistic
Last updated for: 494a797539267ae8418dc42e5feb0a3be33bedfe.
Download the Paperclip jar for this pull request: paper-11831.zip
Maven Publication
The artifacts published by this PR:
- :package:
io.papermc.paper:dev-bundle:1.21.11-pre4-R0.1-SNAPSHOT - :package:
io.papermc.paper:paper-api:1.21.11-pre4-R0.1-SNAPSHOT
Repository Declaration
In order to use the artifacts published by the PR, add the following repository to your buildscript:
repositories {
maven("https://maven-prs.papermc.io/Paper/pr11831") {
name = "Maven for PR #11831" // https://github.com/PaperMC/Paper/pull/11831
mavenContent {
includeModule("io.papermc.paper", "dev-bundle")
includeModule("io.papermc.paper", "paper-api")
}
}
}
I have same issue with it version server 1.21.7