mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Prevent NPE with creatures that are not added to bucket yet.
This commit is contained in:
parent
14cc499421
commit
1e4a54baca
@ -14,6 +14,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Fireball;
|
||||
@ -309,7 +310,12 @@ public class EssentialsProtectEntityListener extends EntityListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
final String creatureName = event.getCreatureType().toString().toLowerCase();
|
||||
final CreatureType creature = event.getCreatureType();
|
||||
if (creature == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final String creatureName = creature.toString().toLowerCase();
|
||||
if (creatureName == null || creatureName.isEmpty())
|
||||
{
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user