当前位置: 首页>>代码示例>>Java>>正文


Java GeneratorType类代码示例

本文整理汇总了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.
}
 
开发者ID:LanternPowered,项目名称:Porygen,代码行数:22,代码来源:PorygenPlugin.java

示例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");
}
 
开发者ID:Proximyst,项目名称:Bukkit2Sponge,代码行数:9,代码来源:FakeServer.java

示例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()));
    }
}
 
开发者ID:Valandur,项目名称:Web-API,代码行数:12,代码来源:CachedGeneratorType.java

示例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;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:32,代码来源:LanternWorldArchetype.java

示例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;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:12,代码来源:DelegateGeneratorType.java

示例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;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:14,代码来源:LanternDimensionType.java

示例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();
}
 
开发者ID:Valandur,项目名称:Web-API,代码行数:5,代码来源:BaseWorldRequest.java

示例8: getGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
    return this.generatorType == null ? this.dimensionType.getDefaultGeneratorType() : this.generatorType;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternWorldArchetype.java

示例9: generator

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public LanternWorldArchetypeBuilder generator(GeneratorType type) {
    this.generatorType = checkNotNull(type, "type");
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:6,代码来源:LanternWorldArchetypeBuilder.java

示例10: getGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
    return this.worldConfig.getGeneration().getGeneratorType();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternWorldProperties.java

示例11: setGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public void setGeneratorType(GeneratorType generatorType) {
    this.worldConfig.getGeneration().setGeneratorType(generatorType);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternWorldProperties.java

示例12: DelegateGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public DelegateGeneratorType(String pluginId, String id, GeneratorType generatorType) {
    super(pluginId, id);
    setGeneratorType(generatorType);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:DelegateGeneratorType.java

示例13: getGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
@Override
public GeneratorType getGeneratorType() {
    return this.world.getProperties().getGeneratorType();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternDimension.java

示例14: getGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public GeneratorType getGeneratorType() {
    return this.generatorType;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:WorldGeneration.java

示例15: setGeneratorType

import org.spongepowered.api.world.GeneratorType; //导入依赖的package包/类
public void setGeneratorType(GeneratorType generatorType) {
    this.generatorType = checkNotNull(generatorType, "generatorType");
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:4,代码来源:WorldGeneration.java


注:本文中的org.spongepowered.api.world.GeneratorType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。