mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-27 04:30:25 +08:00
Fixed NullPointerException when logging player death item drops (fixes #71)
This commit is contained in:
parent
da718de252
commit
bc39bc03d6
@ -20,6 +20,10 @@ import net.coreprotect.consumer.Queue;
|
|||||||
public final class PlayerDropItemListener extends Queue implements Listener {
|
public final class PlayerDropItemListener extends Queue implements Listener {
|
||||||
|
|
||||||
protected static void playerDropItem(Location location, Player player, ItemStack itemStack) {
|
protected static void playerDropItem(Location location, Player player, ItemStack itemStack) {
|
||||||
|
if (itemStack == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String loggingItemId = player.getName().toLowerCase(Locale.ROOT) + "." + location.getBlockX() + "." + location.getBlockY() + "." + location.getBlockZ();
|
String loggingItemId = player.getName().toLowerCase(Locale.ROOT) + "." + location.getBlockX() + "." + location.getBlockY() + "." + location.getBlockZ();
|
||||||
int itemId = getItemId(loggingItemId);
|
int itemId = getItemId(loggingItemId);
|
||||||
|
|
||||||
@ -41,10 +45,6 @@ public final class PlayerDropItemListener extends Queue implements Listener {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
ItemStack itemStack = item.getItemStack();
|
ItemStack itemStack = item.getItemStack();
|
||||||
if (itemStack == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
playerDropItem(location, player, itemStack);
|
playerDropItem(location, player, itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user