Skip to content
Max edited this page Oct 30, 2023 · 1 revision

Container Layer

Amber naturally is not going to be able to control EVERYTHING about your application or service, this is why we give you access to the rawest layer of your configuration. To access this layer, you can use this code:

ResourceContainerService.get(PluginConfig::class.java)

The function ResourceContainerService#get returns the YAMLResourceContainer that houses not only the raw file but also the built-in methods of retrieving and setting data.

Interface Layer

Sometimes, you just want to fetch the interface for your configuration somewhere else. We allow you to do this by using the code:

AutomaticRegistrationService.get<OtherConfig>(OtherConfig::class.java)

This code allows you to get the interface of your configuration. OtherConfig would be the interface. Also, I know that this method is a little funky but since I want natural support with Kotlin AND Java, I am unable to use any reified types so this is what I am going to have to work with.

Clone this wiki locally