Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.github.pylonmc.pylon.core.recipe.vanilla.VanillaRecipeType
import io.github.pylonmc.pylon.core.util.isPylonAndIsNot
import io.github.pylonmc.pylon.core.util.isPylonSimilar
import io.papermc.paper.datacomponent.DataComponentTypes
import io.papermc.paper.event.player.CartographyItemEvent
import org.bukkit.Keyed
import org.bukkit.block.Crafter
import org.bukkit.block.Furnace
Expand Down Expand Up @@ -82,6 +83,16 @@ internal object PylonRecipeListener : Listener {
}
}

@EventHandler(priority = EventPriority.LOWEST)
private fun onCartography(e: CartographyItemEvent) {
val inventory = e.inventory
val hasPylonItems = inventory.any { it.isPylonAndIsNot<VanillaCraftingItem>() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have a VanillaCartographyItem but I think this is fine, and niche enough that it wouldn't be used


if (hasPylonItems) {
inventory.result = null
}
}

@EventHandler(priority = EventPriority.LOWEST)
private fun onCrafterCraft(e: CrafterCraftEvent) {
val crafterState = e.block.state as? Crafter ?: return
Expand Down