SPIGOT-6925: Add minecraft:match_tool in LootContext

This commit is contained in:
Doc 2022-02-21 10:52:08 +11:00 committed by md_5
parent 38f204d8cb
commit d83e9d0812
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -95,6 +95,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
// If there is a player killer, damage source should reflect that in case loot tables use that information // If there is a player killer, damage source should reflect that in case loot tables use that information
setMaybe(builder, LootContextParameters.DAMAGE_SOURCE, DamageSource.playerAttack(nmsKiller)); setMaybe(builder, LootContextParameters.DAMAGE_SOURCE, DamageSource.playerAttack(nmsKiller));
setMaybe(builder, LootContextParameters.LAST_DAMAGE_PLAYER, nmsKiller); // SPIGOT-5603 - Set minecraft:killed_by_player setMaybe(builder, LootContextParameters.LAST_DAMAGE_PLAYER, nmsKiller); // SPIGOT-5603 - Set minecraft:killed_by_player
setMaybe(builder, LootContextParameters.TOOL, nmsKiller.getUseItem()); // SPIGOT-6925 - Set minecraft:match_tool
} }
// SPIGOT-5603 - Use LootContext#lootingModifier // SPIGOT-5603 - Use LootContext#lootingModifier