9
0
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:
LoJoSho
2024-08-18 18:47:21 -05:00
parent a69cdcfe1a
commit 62ef3bedd0
2 changed files with 2 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ plugins {
}
group = "me.lojosho"
version = "0.4.6"
version = "0.4.7"
allprojects {
apply(plugin = "java")

View File

@@ -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);