本文整理匯總了Java中org.spongepowered.api.config.ConfigDir類的典型用法代碼示例。如果您正苦於以下問題:Java ConfigDir類的具體用法?Java ConfigDir怎麽用?Java ConfigDir使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConfigDir類屬於org.spongepowered.api.config包,在下文中一共展示了ConfigDir類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: VirtualTool
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public VirtualTool(@ConfigDir(sharedRoot = true) Path path, Logger logger, PluginContainer container) {
this.dataDir = Sponge.getGame().getSavesDirectory().resolve(PluginData.id);
this.pluginContainer = container;
this.logger = new VTLogger(CText.get(CText.Colors.BLUE, 1, "V") + CText.get(CText.Colors.MAGENTA, 0, "T"));
this.configdirpath = path.resolve(PluginData.id);
this.backpackDir = Paths.get(this.getConfigPath().toString(), "backpacks");
this.configfullpath = Paths.get(this.getConfigPath().toString(), "config.json");
this.settings = new Settings();
}
示例2: AmicusCore
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public AmicusCore(@ConfigDir(sharedRoot = false) @Nonnull final Path configDir,
@Nonnull final Game game) {
instance = this;
this.configProfiles = Maps.newHashMap();
this.configDir = configDir;
this.game = game;
this.configProfilesFile = this.loadConfig();
}
示例3: IPLog
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public IPLog(Logger logger, @ConfigDir(sharedRoot = false) Path path, PluginContainer pluginContainer) {
plugin = this;
this.logger = logger;
this.parentPath = path;
this.pluginContainer = pluginContainer;
}
示例4: Phonon
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public Phonon(Logger logger, @DefaultConfig(sharedRoot = false) ConfigurationLoader<CommentedConfigurationNode> loader,
@ConfigDir(sharedRoot = false) Path configDir, GuiceObjectMapperFactory factory) {
this.logger = logger;
this.loader = loader;
this.configDir = configDir;
this.factory = factory;
this.configs = new HashMap<>();
this.phononCommand = new PhononCommand();
this.phononInjector = Guice.createInjector(new InjectorModule(this, this.phononCommand, new DiscordBot()));
}
示例5: CatClearLag
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public CatClearLag(Logger logger, Game game, @ConfigDir(sharedRoot = false) File configDir, GuiceObjectMapperFactory factory) {
this.logger = logger;
this.game = game;
this.configDir = configDir;
this.factory = factory;
instance = this;
}
示例6: equals
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ConfigDir)) {
return false;
}
final ConfigDir that = (ConfigDir) o;
return sharedRoot() == that.sharedRoot();
}
示例7: MinigameCore
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
private MinigameCore(@ConfigDir(sharedRoot = false) Path configDir, Injector defaultInjector, Logger logger, PluginContainer pluginContainer) {
this.configDir = configDir;
this.defaultInjector = defaultInjector;
this.pluginContainer = pluginContainer;
this.logger = logger;
}
示例8: Settings
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
//We will place more than one config there (i.e. H2/SQLite database)
public Settings(Logger logger, @ConfigDir(sharedRoot = false) Path dataFolder) {
this.logger = logger;
this.dataFolder = dataFolder;
try {
configMapper = ObjectMapper.forClass(Config.class).bindToNew();
textMapper = ObjectMapper.forClass(TextConfig.class).bindToNew();
} catch (ObjectMappingException objMappingExc) {
logger.error("Invalid plugin structure", objMappingExc);
}
}
示例9: LabyRegen
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
public LabyRegen(@ConfigDir(sharedRoot = false) Path pluginConfig, PluginContainer pluginContainer, Logger logger) {
this.pluginConfig = pluginConfig;
this.pluginContainer = pluginContainer;
this.logger = logger;
}
示例10: init
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Inject
void init(@ConfigDir(sharedRoot = false) Provider<Path> path) {
this.path = path;
}
示例11: annotationType
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
@Override
public Class<? extends Annotation> annotationType() {
return ConfigDir.class;
}
示例12: SpongeStatsLite
import org.spongepowered.api.config.ConfigDir; //導入依賴的package包/類
/**
* Constructs a new {@link SpongeStatsLite} client. Normally this should
* be not called manually, but rather through an Guice {@link Inject}.
*
* @param plugin The plugin container
* @param configDir The shared config directory
* @see SpongeStatsLite
*/
@Inject
public SpongeStatsLite(PluginContainer plugin, @ConfigDir(sharedRoot = true) Path configDir) {
super(configDir);
this.plugin = requireNonNull(plugin, "plugin");
}