Open Electroid opened 4 years ago
Working on this...
Thoughts on abstracting out the parser into its own Maven module? And making it only depend on itself(and jdom)
It would mean the module would have its own checks for bukkit and pgm types (Materials, Mobs, etc..), so you would have to convert it into Bukkit stuff when it arrives to the main package again.
PGM sends map.xml file to the parser -> The parser uses the jdom stuff to parse the XML and sends MapModules back out -> PGM reacts to the sent modules accordingly.
This also means you can use the parser for other stuff. Some examples: what this issue describes, in-game XML editors, online graphical representation from xml...
I'd rather we use Bukkit types, and for now not a seperate module. One step at a time.
Then i'm not entirely sure what to do. MapFactoryImpl
already seems like the result to me.
Not sure if answers your request or even half-answers it, but I found a PGM XML schema awhile back. I forked it and make a few corrections to it. It's still not perfect, but it is really helpful for real-time xml validation. It does not validate it like pgm does when loading the map, but at least you can validate the elements, attributes, etc. Plus it speeds up the xml writing process a ton! https://github.com/harvanchik/PGMSchema
Very cool! We should definitely have an "official" version provided by PGM.
Very cool! We should definitely have an "official" version provided by PGM.
Totally agree! I am constantly trying to fix errors in the one I linked.
Users should be able to test and validate their XMLs without running a Bukkit server. At first, this could be a command line tool, potentially even a simple HTTP server.