mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
feat: update CustomFishing integration
This commit is contained in:
@@ -81,7 +81,7 @@ allprojects {
|
||||
compileOnly("LibsDisguises:LibsDisguises:10.0.21") {
|
||||
exclude("org.spigotmc", "spigot")
|
||||
}
|
||||
compileOnly("com.github.Xiao-MoMi:Custom-Fishing:2.1.2")
|
||||
compileOnly("com.github.Xiao-MoMi:Custom-Fishing:2.2.5")
|
||||
compileOnly("com.ticxo.modelengine:ModelEngine:R4.0.2")
|
||||
|
||||
// Lombok <3
|
||||
|
||||
@@ -4,6 +4,7 @@ import me.lojosho.hibiscuscommons.api.events.HibiscusPluginFishEvent;
|
||||
import me.lojosho.hibiscuscommons.hooks.Hook;
|
||||
import net.momirealms.customfishing.api.event.FishingLootSpawnEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
@@ -15,8 +16,8 @@ public class HookCustomFishing extends Hook {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerFish(FishingLootSpawnEvent event) {
|
||||
if (event.getItem() == null) return;
|
||||
HibiscusPluginFishEvent newEvent = new HibiscusPluginFishEvent(this, event.getPlayer(), event.getItem().getItemStack());
|
||||
if (!(event.getEntity() instanceof Item item)) return;
|
||||
HibiscusPluginFishEvent newEvent = new HibiscusPluginFishEvent(this, event.getPlayer(), item.getItemStack());
|
||||
Bukkit.getPluginManager().callEvent(newEvent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user