OtherDrops

226k Downloads

Problem with CREATURE_ANY?

Zarius opened this issue ยท 10 comments

commented
2011-09-20 17:46:13 [INFO] [OtherDrops:2.0-beta5] Loading file: otherdrops-drops.yml
2011-09-20 17:46:13 [INFO] [OtherDrops:2.0-beta5] Loading file: rofang-drops.yml
2011-09-20 17:46:13 [WARNING] [OtherDrops:2.0-beta5] Unrecognized target (skipping): WOODEN_DOOR
2011-09-20 17:46:13 [WARNING] [OtherDrops:2.0-beta5] Unrecognized target (skipping): ANY_DIODE_BLOCK
2011-09-20 17:46:13 [SEVERE] Error occurred while enabling OtherDrops v2.0-beta5 (Is it up to date?): No enum const class org.bukkit.entity.CreatureType.ANY
java.lang.IllegalArgumentException: No enum const class org.bukkit.entity.CreatureType.ANY
at java.lang.Enum.valueOf(Unknown Source)
at org.bukkit.entity.CreatureType.valueOf(CreatureType.java:7)
at com.gmail.zariust.otherdrops.subject.CreatureSubject.parse(CreatureSubject.java:128)
at com.gmail.zariust.otherdrops.OtherDropsConfig.parseTarget(OtherDropsConfig.java:677)
at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDropsFile(OtherDropsConfig.java:260)
at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDropsFile(OtherDropsConfig.java:282)
at com.gmail.zariust.otherdrops.OtherDropsConfig.loadConfig(OtherDropsConfig.java:186)
at com.gmail.zariust.otherdrops.OtherDropsConfig.load(OtherDropsConfig.java:122)
at com.gmail.zariust.otherdrops.OtherDrops.onEnable(OtherDrops.java:250)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:906)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)

Forum post here: http://forums.bukkit.org/threads/mech-otherdrops-2-0-ultimate-block-mob-player-drop-editing-supports-1-8-1060-1141.21074/page-46#post-686490

commented

Hmm, I see that CreatureGroup.java has CREATURE_ANY but other files refer to ANY_CREATURE?

commented

Oh, the changes I just committed might (at least partially) fix this, since they'll reduce IllegalArgumentExceptions from enums in general (and probably eliminate them altogether). I think the code was written in the assumption that valueOf would return null when the value is invalid, in which case my commit would fully fix this.

Haven't pushed it yet, though.

commented

I'm assuming CREATURE_ANY doesn't work (I can't test it at the moment) - does the your fix just remove the error & allow CREATURE_ANY to work?

commented

I suspect the aforementioned fix didn't fix it, but I just committed something that I believe would.

The fix I mentioned before just removes the error and assigns null instead. It was probably integral to the fix, but not a full fix.

commented

Right; in theory either one should work. However, note the actual error: it's referring to CreatureType.ANY, not CreatureGroup.CREATURE_ANY.

commented

Yeah, I saw the post in the forum - makes sense now that you mentioned the CREATURE_ bit being stripped off. You mentioned having a fix?

commented

Yeah, I think so. Haven't pushed yet.

commented

Are you planning a push soon? I could do a little testing but heading to sleep soonish.

commented

I posted that pretty much just as I was going out the door. I'll push now.

commented

CREATURE_ANY fixed at some point and tested fine just now.