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"
|
group = "me.lojosho"
|
||||||
version = "0.4.6"
|
version = "0.4.7"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class HookCustomFishing extends Hook {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerFish(FishingLootSpawnEvent event) {
|
public void onPlayerFish(FishingLootSpawnEvent event) {
|
||||||
|
if (event.getEntity() == null) return;
|
||||||
if (!(event.getEntity() instanceof Item item)) return;
|
if (!(event.getEntity() instanceof Item item)) return;
|
||||||
HibiscusPluginFishEvent newEvent = new HibiscusPluginFishEvent(this, event.getPlayer(), item.getItemStack());
|
HibiscusPluginFishEvent newEvent = new HibiscusPluginFishEvent(this, event.getPlayer(), item.getItemStack());
|
||||||
Bukkit.getPluginManager().callEvent(newEvent);
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user