Hey,
I’m just about done a few-hour-long rewrite of a big part of my program/game and I can’t seem to figure out the cause of a, probably obvious, error that’s showing up. It’s probably just because I’m up pretty late but I can’t seem to figure out what’s causing the error I’m getting.
The error is:
DBLoader(Inventory Class: The specified item type doesn't exist. There is no error handleing for this.
/XML/Items/Weapons/Sword.xml
The error seems pretty straightforward since I wrote it up myself for myself but it’s making no sense from what my sleepy-eyes can see. The ItemType Sword does exist and the xml file lists the proper ItemType in all caps just as it should; so I’m at a loss for what the problem is unless my eyes have been messing with me and there’s a typo in one of the SWORD strings…
The inside of the Sword.xml file is:
<body>
<item>
<id>0</id>
<name>Test Sword</name>
<rarity>COMMON</rarity>
<reqLevel>1</reqLevel>
<bonusStrength>1</bonusStrength>
<bonusDexterity>0</bonusDexterity>
<bonusConstitution>0</bonusConstitution>
<bonusIntelligence>0</bonusIntelligence>
<bonusWisdom>0</bonusWisdom>
<bonusCharisma>0</bonusCharisma>
<itemType>SWORD</itemType>
<damageMin>1</damageMin>
<damageMax>10</damageMax>
<bonusDamage>0</bonusDamage>
</item>
<item>
<id>1</id>
<name>Wooden Stick</name>
<rarity>COMMON</rarity>
<reqLevel>1</reqLevel>
<bonusStrength>1</bonusStrength>
<bonusDexterity>0</bonusDexterity>
<bonusConstitution>0</bonusConstitution>
<bonusIntelligence>0</bonusIntelligence>
<bonusWisdom>0</bonusWisdom>
<bonusCharisma>0</bonusCharisma>
<itemType>SWORD</itemType>
<damageMin>1</damageMin>
<damageMax>7</damageMax>
<bonusDamage>0</bonusDamage>
</item>
</body>
Here is the DBLoader class:
https://github.com/Valkryst/Project_02/blob/master/src/main/java/valkryst/item/DBLoader.java
Here is the ItemType class:
https://github.com/Valkryst/Project_02/blob/master/src/main/java/valkryst/type/ItemType.java
What is supposed to happen is that the DBLoader class is called when the program starts. It then begins to loop through every single xml file to load all of the items into the game. That’s pretty much it.
Thanks for any replies!