本文整理汇总了Java中org.spongepowered.api.world.GeneratorType类的典型用法代码示例。如果您正苦于以下问题:Java GeneratorType类的具体用法?Java GeneratorType怎么用?Java GeneratorType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeneratorType类属于org.spongepowered.api.world包,在下文中一共展示了GeneratorType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onGamePreInit
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Listener
public void onGamePreInit(GamePreInitializationEvent event) {
// Register the generator types
this.game.getRegistry().register(GeneratorType.class, new OverworldGeneratorType(
this.container.getId(), "overworld", "Porygen Overworld"));
this.game.getRegistry().register(GeneratorType.class, new NetherGeneratorType(
this.container.getId(), "nether", "Porygen Nether"));
this.game.getRegistry().register(GeneratorType.class, new TheEndGeneratorType(
this.container.getId(), "the_end", "Porygen The End"));
// TODO
// These will just be the same as overworld, but with some custom settings
this.game.getRegistry().register(GeneratorType.class, new OverworldGeneratorType(
this.container.getId(), "amplified", "Porygen Amplified Overworld"));
this.game.getRegistry().register(GeneratorType.class, new OverworldGeneratorType(
this.container.getId(), "large_biomes", "Porygen Large Biomes Overworld"));
// The default-world-gen.json is lantern related, a way to register the porygen
// generator types as the default ones. The lantern default ones are flat generator,
// this plugin is required for awesomeness.
}
示例2: getWorldType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public String getWorldType() {
if (!Sponge.isServerAvailable()) {
return "NORMAL";
}
Optional<WorldProperties> properties = Sponge.getServer().getDefaultWorld();
return properties.map(WorldProperties::getGeneratorType).map(GeneratorType::getName).orElse("NORMAL");
}
示例3: CachedGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public CachedGeneratorType(GeneratorType generatorType) {
super(generatorType);
for (DataQuery query : generatorType.getGeneratorSettings().getKeys(true)) {
Optional val = generatorType.getGeneratorSettings().get(query);
if (!val.isPresent())
continue;
this.settings.put(query.asString("."), WebAPI.getCacheService().asCachedObject(val.get()));
}
}
示例4: LanternWorldArchetype
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
LanternWorldArchetype(String id, String name, GameMode gameMode, LanternDimensionType<?> dimensionType, @Nullable GeneratorType generatorType,
Collection<WorldGeneratorModifier> generatorModifiers, @Nullable DataContainer generatorSettings, Difficulty difficulty,
SerializationBehavior serializationBehavior, LanternPortalAgentType portalAgentType, boolean hardcore, boolean enabled,
boolean loadsOnStartup, @Nullable Boolean keepsSpawnLoaded, boolean usesMapFeatures, boolean pvpEnabled, boolean generateBonusChest,
boolean commandsAllowed, @Nullable Boolean waterEvaporates, @Nullable Boolean allowPlayerRespawns, boolean generateSpawnOnLoad,
boolean isSeedRandomized, long seed, int buildHeight) {
this.serializationBehavior = serializationBehavior;
this.generateSpawnOnLoad = generateSpawnOnLoad;
this.allowPlayerRespawns = allowPlayerRespawns;
this.generatorModifiers = generatorModifiers;
this.generatorSettings = generatorSettings;
this.generateBonusChest = generateBonusChest;
this.keepsSpawnLoaded = keepsSpawnLoaded;
this.usesMapFeatures = usesMapFeatures;
this.portalAgentType = portalAgentType;
this.commandsAllowed = commandsAllowed;
this.waterEvaporates = waterEvaporates;
this.loadsOnStartup = loadsOnStartup;
this.dimensionType = dimensionType;
this.generatorType = generatorType;
this.isSeedRandomized = isSeedRandomized;
this.buildHeight = buildHeight;
this.pvpEnabled = pvpEnabled;
this.difficulty = difficulty;
this.hardcore = hardcore;
this.gameMode = gameMode;
this.enabled = enabled;
this.name = name;
this.seed = seed;
this.id = id;
}
示例5: setGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
/**
* Sets the actual {@link GeneratorType}.
*
* @param generatorType The generator type
*/
public void setGeneratorType(GeneratorType generatorType) {
checkNotNull(generatorType, "generatorType");
this.generatorType = generatorType;
this.minimalSpawnHeight = Integer.MAX_VALUE;
this.generatorHeight = Integer.MAX_VALUE;
}
示例6: LanternDimensionType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public LanternDimensionType(String pluginId, String name, int internalId, Class<T> dimensionClass,
GeneratorType defaultGeneratorType, boolean keepSpawnLoaded, boolean waterEvaporates,
boolean hasSky, boolean allowsPlayerRespawns, BiFunction<LanternWorld, LanternDimensionType<T>, T> supplier) {
super(pluginId, name, internalId);
this.dimContext = new Context(Context.DIMENSION_KEY, this.getId());
this.defaultGeneratorType = defaultGeneratorType;
this.allowsPlayerRespawns = allowsPlayerRespawns;
this.keepSpawnLoaded = keepSpawnLoaded;
this.waterEvaporates = waterEvaporates;
this.dimensionClass = dimensionClass;
this.supplier = supplier;
this.hasSky = hasSky;
}
示例7: getGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public Optional<GeneratorType> getGeneratorType() {
Collection<GeneratorType> types = Sponge.getRegistry().getAllOf(GeneratorType.class);
return types.stream().filter(g -> g.getId().equalsIgnoreCase(generator) || g.getName().equalsIgnoreCase(generator)).findAny();
}
示例8: getGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
return this.generatorType == null ? this.dimensionType.getDefaultGeneratorType() : this.generatorType;
}
示例9: generator
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public LanternWorldArchetypeBuilder generator(GeneratorType type) {
this.generatorType = checkNotNull(type, "type");
return this;
}
示例10: getGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
return this.worldConfig.getGeneration().getGeneratorType();
}
示例11: setGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public void setGeneratorType(GeneratorType generatorType) {
this.worldConfig.getGeneration().setGeneratorType(generatorType);
}
示例12: DelegateGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public DelegateGeneratorType(String pluginId, String id, GeneratorType generatorType) {
super(pluginId, id);
setGeneratorType(generatorType);
}
示例13: getGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
return this.world.getProperties().getGeneratorType();
}
示例14: getGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public GeneratorType getGeneratorType() {
return this.generatorType;
}
示例15: setGeneratorType
import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public void setGeneratorType(GeneratorType generatorType) {
this.generatorType = checkNotNull(generatorType, "generatorType");
}