Exclude kit items from drops on death
Prevent players from dropping kit-owned items when they die by filtering out kit items before dropping inventory contents. Added KitManager.isKitItem(player, item) which checks the player's selected kit and compares against the kit's cached items (using isSimilar). Also added the ItemStack import required for the new method.
This commit is contained in:
@@ -263,9 +263,11 @@ class GameManager(
|
||||
plugin.rankingManager.registerRoundKill( killer.uniqueId )
|
||||
}
|
||||
|
||||
player.inventory.contents.filterNotNull().forEach {
|
||||
player.world.dropItemNaturally( player.location, it )
|
||||
}
|
||||
player.inventory.contents.filterNotNull()
|
||||
.filter { !plugin.kitManager.isKitItem( player, it ) }
|
||||
.forEach { item ->
|
||||
player.world.dropItemNaturally( player.location, item )
|
||||
}
|
||||
|
||||
val msgKey = if ( killer != null ) "game.death-killed" else "game.death-pve"
|
||||
val killerName = killer?.name ?: "Environment"
|
||||
|
||||
Reference in New Issue
Block a user