From 35492fa86000e6d41c899a5d5d5e06509db6d5c6 Mon Sep 17 00:00:00 2001 From: Zino Date: Tue, 16 Jul 2013 13:30:46 +0200 Subject: [PATCH] *ItemData, multiple names --- src/me/blackvein/quests/ItemData.java | 9 +++++---- src/me/blackvein/quests/items.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/me/blackvein/quests/ItemData.java b/src/me/blackvein/quests/ItemData.java index aa4b2f885..1c74f042b 100644 --- a/src/me/blackvein/quests/ItemData.java +++ b/src/me/blackvein/quests/ItemData.java @@ -25,7 +25,7 @@ public class ItemData { while(scanner.hasNextLine()) { String[] line = scanner.nextLine().split("="); if (line.length > 1) { - String name = line[0]; + String[] name = line[0].split(","); Data data; String[] str = line[1].split(","); @@ -40,9 +40,10 @@ public class ItemData { mdata = Byte.parseByte(str[1]); } - data = new Data(name, id, mdata); - - map.put(name, data); + for (String n : name) { + data = new Data(n, id, mdata); + map.put(n, data); + } } } } diff --git a/src/me/blackvein/quests/items.txt b/src/me/blackvein/quests/items.txt index 47869213d..a5f3aaf92 100644 --- a/src/me/blackvein/quests/items.txt +++ b/src/me/blackvein/quests/items.txt @@ -1,7 +1,7 @@ Stone=1 Grass=2 Dirt=3 -Cobblestone=4 +Cobblestone,Cobble=4 WoodenPlank=5,0 RedwoodPlank=5,1 BirchPlank=5,2