Pass the 'includeName' flag to the ItemTossEvent (#7875)

(Same as #7758 for 1.16)
The PlayerEntity#dropItem(ItemStack, boolean) method (PlayerEntity#drop(ItemStack, boolean) for mojmap), does not pass the second argument, the 'includeName' flag, on to the ItemTossEvent.

This leads to situations where the player drops an item and the resulting ItemEntity does not have a thrower id.
For example, items thrown by a player from inside a ContainerScreen do not have a thrower id.

This pull request passes the 'includeName' flag on to the ItemTossEvent, thus resolving the issue.
This commit is contained in:
SuperMartijn642 authored and GitHub committed 2021-07-24 16:54:39 +02:00
1 parent 38a9fe304c
commit c63db5758d
1 file changed
+1 -1
@@ -88,7 +88,7 @@
@Nullable
public ItemEntity func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) {
- return this.func_146097_a(p_71019_1_, false, p_71019_2_);
+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false);
+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, p_71019_2_);
}
@Nullable