1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-16 21:21:20 +01:00

Check if item have itemmeta set

This commit is contained in:
Zrips 2017-07-24 13:25:23 +03:00
parent 2370c8afc2
commit 4318d4bf60
3 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>Jobs</groupId>
<artifactId>jobs</artifactId>
<version>3.9.8</version>
<version>4.0.0</version>
<name>Jobs</name>
<url>http://maven.apache.org</url>
<properties>

View File

@ -518,7 +518,7 @@ public class JobsPaymentListener implements Listener {
// If we need to pay only by each craft action we will skip calculation how much was crafted
if (!Jobs.getGCManager().PayForEachCraft) {
if (resultStack.getItemMeta().hasDisplayName())
if (resultStack.hasItemMeta() && resultStack.getItemMeta().hasDisplayName())
Jobs.action(jPlayer, new ItemNameActionInfo(ChatColor.stripColor(resultStack.getItemMeta().getDisplayName()), ActionType.CRAFT));
else
Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT));
@ -538,7 +538,7 @@ public class JobsPaymentListener implements Listener {
int newItemsCount = toCraft.getAmount();
while (newItemsCount >= 0) {
newItemsCount--;
if (resultStack.getItemMeta().hasDisplayName())
if (resultStack.hasItemMeta() && resultStack.getItemMeta().hasDisplayName())
Jobs.action(jPlayer, new ItemNameActionInfo(ChatColor.stripColor(resultStack.getItemMeta().getDisplayName()), ActionType.CRAFT));
else
Jobs.action(jPlayer, new ItemActionInfo(resultStack, ActionType.CRAFT));

View File

@ -1,7 +1,7 @@
name: Jobs
description: Jobs Plugin for the BukkitAPI
main: com.gamingmesh.jobs.Jobs
version: 3.9.8
version: 4.0.0
website: https://www.spigotmc.org/resources/jobs-reborn.4216/
author: phrstbrn
softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet]