Skip to content

Commit

Permalink
Add half of functionality required for #476
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Oct 19, 2013
1 parent bf80141 commit cffbdab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dInventory.java
Expand Up @@ -19,6 +19,7 @@
import org.bukkit.inventory.meta.BookMeta;

import net.aufdemrand.denizen.objects.aH.Argument;
import net.aufdemrand.denizen.objects.aH.PrimitiveType;
import net.aufdemrand.denizen.objects.notable.Notable;
import net.aufdemrand.denizen.objects.notable.NotableManager;
import net.aufdemrand.denizen.objects.notable.Note;
Expand Down Expand Up @@ -94,9 +95,13 @@ public static dInventory valueOf(String string, dPlayer player, dNPC npc) {
String holder = m.group(3);

if (type.equalsIgnoreCase("generic")) {
if (Argument.valueOf(holder).matchesEnum(InventoryType.values())) {
Argument arg = Argument.valueOf(holder);
if (arg.matchesEnum(InventoryType.values())) {
return new dInventory(InventoryType.valueOf(holder.toUpperCase()));
}
else if (arg.matchesPrimitive(PrimitiveType.Integer)) {
return new dInventory(arg.asElement().asInt());
}
else {
dB.echoError("That type of inventory does not exist!");
}
Expand Down

0 comments on commit cffbdab

Please sign in to comment.