Skip to content

Commit

Permalink
#2 - added filter for armor item in hands
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Jul 28, 2023
1 parent 6b765dc commit 318db2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ makeevrserg.java.ktarget=17
# Project
makeevrserg.project.name=IaHook
makeevrserg.project.group=ru.astrainteractive.iahook
makeevrserg.project.version.string=0.0.8
makeevrserg.project.version.string=0.0.9
makeevrserg.project.description=ItemsAdder hook for EmpireSMP
makeevrserg.project.developers=makeevrserg|Makeev Roman|[email protected]
makeevrserg.project.url=https://empireprojekt.ru
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ class PassiveManaRestore(
val allContent = listOf(
player.inventory.itemInMainHand,
player.inventory.itemInOffHand
) + player.inventory.armorContents.filterNotNull()
).filter {
!it.type.name.endsWith("_HELMET", true)
&& !it.type.name.endsWith("_CHESTPLATE", true)
&& !it.type.name.endsWith("_LEGGINGS", true)
&& !it.type.name.endsWith("_BOOTS", true)
} + player.inventory.armorContents.filterNotNull()

allContent.firstOrNull {
val customItem = it.let(CustomStack::byItemStack)
Expand Down

0 comments on commit 318db2d

Please sign in to comment.