mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
fix: CustomFishing getEntity is can be null, closes #7
This commit is contained in:
@@ -12,7 +12,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "me.lojosho"
|
||||
version = "0.4.6"
|
||||
version = "0.4.7"
|
||||
|
||||
allprojects {
|
||||
apply(plugin = "java")
|
||||
|
||||
@@ -16,6 +16,7 @@ public class HookCustomFishing extends Hook {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPlayerFish(FishingLootSpawnEvent event) {
|
||||
if (event.getEntity() == null) return;
|
||||
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