How to Use Causes D:

Hey there!

Just for testing purposes, I’m trying to get a certain area to turn to redstone blocks. However, whenever I try to do this, I’m given an error that I don’t quite understand how to fix.

Here’s the error: http://hastebin.com/ajefalowuc.vbs

Here’s the class where that code is called: http://hastebin.com/azekupuyec.scala

And lastly, my main plugin class: http://hastebin.com/hugifepalo.java

In my mind, it should be working because Avatar.INSTANCE is set before I even call that code.

Thanks for any help! :smiley:

Your code is almost correct. The root cause detection only checks for instances of PluginContainer (a class that wraps your main class).
You can obtain your plugin container from INSTANCE using the plugin manager:

PluginContainer container = Sponge.getPluginManager().fromInstance(Avatar.INSTANCE).get();

Alternatively you can use @Inject PluginContainer container in the main class (the same way you inject the logger) to obtain the container.

1 Like

Perfect. Thank you!