mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Test commit
This commit is contained in:
parent
a8754bfa13
commit
c78a1aae05
@ -3514,7 +3514,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
deliveryMessages.addAll(config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".delivery-messages"));
|
||||
|
||||
for (String item : itemsToDeliver) {
|
||||
|
||||
getLogger().severe("item: " + item);
|
||||
ItemStack is = ItemUtil.readItemStack(item);
|
||||
|
||||
if (is != null) {
|
||||
|
@ -79,10 +79,11 @@ public class ItemUtil implements ColorUtil {
|
||||
//Formats -> name-name:amount-amount:data-data:enchantment-enchantment level:displayname-displayname:lore-lore:
|
||||
//Returns null if invalid format
|
||||
public static ItemStack readItemStack(String data) {
|
||||
|
||||
plugin.getLogger().severe("data: " + data);
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ItemStack stack = null;
|
||||
String[] args = data.split(":");
|
||||
ItemMeta meta = null;
|
||||
@ -93,7 +94,6 @@ public class ItemUtil implements ColorUtil {
|
||||
stack = new ItemStack(Material.matchMaterial(arg.substring(3)));
|
||||
meta = stack.getItemMeta();
|
||||
} else if (arg.startsWith("amount-")) {
|
||||
if(arg.length() >= 8 && stack != null)
|
||||
stack.setAmount(Integer.parseInt(arg.substring(7)));
|
||||
} else if (arg.startsWith("data-")) {
|
||||
stack.setDurability(Short.parseShort(arg.substring(5)));
|
||||
|
Loading…
Reference in New Issue
Block a user