Fork me on GitHub

okay, couldn't help myself, some more progress on Citizens @devurandom


Thanks, this looks awesome! I will review it tomorrow.


Thanks for the explanations! They helped me a lot in understanding some choices you made for Witchcraft.


@U07FP7QJ0 I tried to send the citizens and the citizens.trait namespaces through my REPL to the server and then did:

    [lambdaisland.witchcraft :as wc]
    [lambdaisland.witchcraft.citizens :as citizens]))
; => nil

(citizens/make-trait "mytrait"
                      (fn [this]
                        (println "mytrait attached to" (.getNPC this)))})
I get the reply:
Execution error (ClassFormatError) at java.lang.ClassLoader/defineClass1 (
Illegal field name "lambdaisland.witchcraft.citizens.trait_SLASH_trait_post_init__var" in class my/name/space
What is my mistake?


I realized that just calling .addTrait with a trait instance will break citizens persistence and restore, so I came up with what I think is an elegant solution, wrapping a call to gen-class but loading it directly into memory instead of writing out a class file

🎉 2