Configuration API vs. instance variables

Discussion in 'Spigot Plugin Development' started by Alphexon, May 3, 2017.

  1. I have a class with many variables. It's part of a loot chest plugin designed for high customization, and the class represents one of the chests. As I've been adding more options, it has become impractical to use only instance variables in one class. For example, there are sounds for different events, such as opening or closing the chest. Those sounds also have their own variables, such as pitch or volume. This could easily be handled using the Configuration API, but I'm attempting to preserve the ability to edit the chest's properties using the in-game command prompt. I would like to able to modify the chest's properties simply by typing something along the lines of, "/lootchest set sounds.open.volume 1.0"

    My question is - is there any problem accessing the Configuration API directly for data? Or is a middle-man data structure made up of subclasses a better idea? The only other plugin I can think of that involves manipulating a lot of different properties in-game would be WorldGuard, with its flag system.
     
  2. I think it wouldn't be a problem, right?