<RobertNicholas[m>
And trying to implement the differed registers from the ruby end
<enebo[m]>
Robert Nicholas: put '&' in front of ->
<enebo[m]>
I think you are passing the lambda as a parameter and not a block parameter
<RobertNicholas[m>
if that's all it is 🤦♂️
<enebo[m]>
@BLOCKS.register("bigboi") { @block }
<enebo[m]>
lambda is good to prevent arity mismatches but I think an ordinary proc may work better here
<RobertNicholas[m>
hmm no dice there either, it compiles and boots but am not actually seeing blocks getting registered (and showing up in game) gonna need to debug a bit more but thanks for pushing me the right direction :)
<enebo[m]>
I think based on what the API said the snippet above should work unless somehow it is something with the lifecycle of Example going away before the API calls .get()
<enebo[m]>
Perhaps putting a puts/log in there can also tell you if you see it being called
<enebo[m]>
So this appears to want a class which has annotations. even if you to Example.java_class this class will have no annotations to process. I am not sure how the example related to RubyCore but I am guessing at some level you will have a java type which has some basic annotations which represent what Example will be or something like that?
<enebo[m]>
This brings back some nightmares in bukkit and bootstrapping but bukkit was not so anno heavy so it was easier (I am guessing so anyways)
<RobertNicholas[m>
sorry got pulled away
<RobertNicholas[m>
you're right, that explains why it's not working
<RobertNicholas[m>
I was hoping to get around the old method which also had a problem because of annotations but it looks like I'm going to have to write some type of bridge
<RobertNicholas[m>
I think what I'll probably do is implement the registries in java and just have ruby able to call them to add things to them
<RobertNicholas[m>
the hope was to have the java layer eventually be completely separate so I wouldn't have to maintain a java layer, and ruby layer of the same thing, and to leave more room for other libraries (e.g. fabric / sponge support would mean just adding a new file for each with the appropriate java_imports)
<RobertNicholas[m>
what blocks jruby from supporting annotations? Am curious if there'd be a way it could, e.g. defining a @annotations variable in the class object that gets translated. Even if it meant each function / class with an annotation needed specified manually somewhere it'd be cool to have it
<RobertNicholas[m>
update, turns out you were right about the cause before
<RobertNicholas[m>
I moved the differed registers into the java side then tried to add to them from the ruby side and now the error isn't being splat
<RobertNicholas[m>
"org.jruby.embed.InvokeFailedException: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegistryEvent.Register has been fired."