Yea, I've seen that. It does the plugins a little differently. I did not 
see any examples of function annotations in his Clojure code, though.

Ryan

On Friday, January 25, 2013 5:08:49 PM UTC-6, AtKaaZ wrote:
>
> Hi. Check this out: https://github.com/CmdrDats/clj-minecraft
>
>
> On Fri, Jan 25, 2013 at 11:14 PM, Ryan Cole <[email protected]<javascript:>
> > wrote:
>
>> Hi all, beginner here,
>>
>> I'm trying to write a Minecraft plugin in Clojure, and use AOT so that 
>> the Minecraft server can load it right up. I've got this much going, and 
>> all as well. The server expect some of my functions in a class that I'm 
>> extending to use an appropriate annotation on the function.
>>
>> How do I add these annotations? I've Googled around and see that it looks 
>> like support for this was added back in 2010, so I'm sure it's possible. 
>> Maybe I've seen the solution but didn't realize that it was a solution. 
>> Clojure still looks pretty alien to me, so crazy things like this are rough 
>> to search for and realize when the answer is in front of me.
>>
>> For example, the Java document for the Minecraft server says that my 
>> function should conform to the following definition:
>>
>> ```
>>
>> @EventHandlerpublic void onPlayerLogin(PlayerLoginEvent event) {
>>     // Your code here...}
>>
>> ```
>>
>>
>> I've got the following Clojure code that the server will actually load and 
>> it will call the `onEnable` and `onDisable` function here, but the one that 
>> requires the annotation does not get called.
>>
>>
>> ```
>>
>> (ns com.github.ryancole.bukkit.hello-world
>>   (:import [org.bukkit Bukkit])
>>   (:gen-class :extends org.bukkit.plugin.java.JavaPlugin
>>               :name com.github.ryancole.bukkit.hello-world.Hello
>>               :prefix hello-))
>>
>> (defn hello-onEnable [this]
>>   (.info (.getLogger this) "hello world has been enabled"))
>>
>> (defn hello-onDisable [this]
>>   (.info (.getLogger this) "hello world has been disabled"))
>>
>> (defn hello-onPlayerLogin [this evnt]
>>   (.info (.getLogger this) "player logged in"))
>>
>> ```
>>
>>
>> Any ideas?
>>
>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]<javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>  
>>  
>>
>
>
>
> -- 
> I may be wrong or incomplete.
> Please express any corrections / additions,
> they are encouraged and appreciated.
> At least one entity is bound to be transformed if you do ;)
>  

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Reply via email to