Fixed an issue with MMOCore trigger

This commit is contained in:
Indyuce 2020-03-27 21:46:44 +01:00
parent 246cb2d9a1
commit 580f8fea79
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -4,10 +4,10 @@ import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import net.Indyuce.mmocore.api.item.SmartGive;
import net.Indyuce.mmocore.api.load.MMOLineConfig;
import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.quest.trigger.Trigger;
import net.Indyuce.mmocore.api.util.item.SmartGive;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
@ -33,7 +33,9 @@ public class MMOItemTrigger extends Trigger {
@Override
public void apply(PlayerData player) {
ItemStack item = MMOItems.plugin.getItems().getItem(type, id);
if(item == null) { MMOItems.plugin.getLogger().warning("[MMOCore Quest Trigger] Couldn't load MMOItem"); return; }
if (item == null || item.getType() == Material.AIR)
return;
item.setAmount(amount);
if (item != null && item.getType() != Material.AIR)
new SmartGive(player.getPlayer()).give(item);