本文整理汇总了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");
}