Don't allow to prime primed hammer

This commit is contained in:
DBotThePony 2023-07-23 16:02:59 +07:00
parent 94acd58516
commit 7eec1c7032
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -38,7 +38,7 @@ class ExplosiveHammerPrimingRecipe(private val _id: ResourceLocation, val payloa
override fun matches(pContainer: CraftingContainer, pLevel: Level): Boolean { override fun matches(pContainer: CraftingContainer, pLevel: Level): Boolean {
val result = pContainer.stream().filter { it.isNotEmpty }.toList() val result = pContainer.stream().filter { it.isNotEmpty }.toList()
if (result.size != 3) return false if (result.size != 3) return false
return result.any { it.item is ExplosiveHammerItem } && return result.any { it.item is ExplosiveHammerItem && !(it.item as ExplosiveHammerItem).isPrimed(it) } &&
result.any { it.`is`(Tags.Items.GUNPOWDER) } && result.any { it.`is`(Tags.Items.GUNPOWDER) } &&
result.any { payload.test(it) } result.any { payload.test(it) }
} }