!Fixed another "Player must be online" error

This commit is contained in:
ASangarin 2020-09-26 19:47:55 +02:00
parent b27ce4bd1b
commit 89b78af5bc

View File

@ -39,6 +39,7 @@ public class GetItemObjective extends Objective {
@EventHandler
public void a(CitizenInteractEvent event) {
Player player = event.getPlayer();
if(!getQuestProgress().getPlayer().isOnline()) return;
if (player.equals(getQuestProgress().getPlayer().getPlayer()) && event.getNPC().getId() == npcId && player.getInventory().getItemInMainHand() != null) {
ItemStack item = player.getInventory().getItemInMainHand();
if (item.getType() == material && item.getAmount() >= required) {