From 35026dded4a944b457503cf1e911cbe7cb15342b Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Tue, 7 May 2024 14:15:15 -0400 Subject: [PATCH] fix: fix EnderCrystalEnhancer listener --- .../implementation/items/misc/FakePotionItem.kt | 3 +-- .../implementation/listeners/EnderCrystalEnhancerListener.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/items/misc/FakePotionItem.kt b/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/items/misc/FakePotionItem.kt index bd75ec5..f5cb6e7 100644 --- a/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/items/misc/FakePotionItem.kt +++ b/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/items/misc/FakePotionItem.kt @@ -5,7 +5,6 @@ import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType import io.github.thebusybiscuit.slimefun4.core.handlers.ItemConsumptionHandler import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem -import org.bukkit.entity.Player import org.bukkit.event.player.PlayerItemConsumeEvent import org.bukkit.inventory.ItemStack @@ -15,7 +14,7 @@ class FakePotionItem( recipeType: RecipeType, recipe: Array ) : SimpleSlimefunItem(itemGroup, item, recipeType, recipe) { - override fun getItemHandler() = ItemConsumptionHandler { e: PlayerItemConsumeEvent, _: Player, _: ItemStack -> + override fun getItemHandler() = ItemConsumptionHandler { e: PlayerItemConsumeEvent, _, _ -> e.isCancelled = true } } diff --git a/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/listeners/EnderCrystalEnhancerListener.kt b/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/listeners/EnderCrystalEnhancerListener.kt index a88da2f..55df04c 100644 --- a/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/listeners/EnderCrystalEnhancerListener.kt +++ b/src/main/kotlin/net/guizhanss/ultimategenerators2/implementation/listeners/EnderCrystalEnhancerListener.kt @@ -20,7 +20,7 @@ class EnderCrystalEnhancerListener(plugin: UltimateGenerators2) : Listener { @EventHandler fun onUse(e: PlayerInteractEntityEvent) { - if (e.rightClicked is EnderCrystal) { + if (e.rightClicked !is EnderCrystal) { return }