• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DefaultGameRules类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.spongepowered.api.world.gamerule.DefaultGameRules的典型用法代码示例。如果您正苦于以下问题:Java DefaultGameRules类的具体用法?Java DefaultGameRules怎么用?Java DefaultGameRules使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DefaultGameRules类属于org.spongepowered.api.world.gamerule包,在下文中一共展示了DefaultGameRules类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: complete

点赞 3

import org.spongepowered.api.world.gamerule.DefaultGameRules; //导入依赖的package包/类
@Override
public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) {
    return Arrays.asList(
            DefaultGameRules.COMMAND_BLOCK_OUTPUT,
            DefaultGameRules.DISABLE_ELYTRA_MOVEMENT_CHECK,
            DefaultGameRules.DO_DAYLIGHT_CYCLE,
            DefaultGameRules.DO_ENTITY_DROPS,
            DefaultGameRules.DO_FIRE_TICK,
            DefaultGameRules.DO_MOB_LOOT,
            DefaultGameRules.DO_MOB_SPAWNING,
            DefaultGameRules.DO_TILE_DROPS,
            DefaultGameRules.DO_WEATHER_CYCLE,
            DefaultGameRules.KEEP_INVENTORY,
            DefaultGameRules.LOG_ADMIN_COMMANDS,
            DefaultGameRules.MAX_ENTITY_CRAMMING,
            DefaultGameRules.MOB_GRIEFING,
            DefaultGameRules.NATURAL_REGENERATION,
            DefaultGameRules.RANDOM_TICK_SPEED,
            DefaultGameRules.REDUCED_DEBUG_INFO,
            DefaultGameRules.SEND_COMMAND_FEEDBACK,
            DefaultGameRules.SHOW_DEATH_MESSAGES,
            DefaultGameRules.SPAWN_RADIUS,
            DefaultGameRules.SPECTATORS_GENERATE_CHUNKS
    );
}
 

开发者ID:Bammerbom,
项目名称:UltimateCore,
代码行数:26,
代码来源:GameruleArgument.java

示例2: setTime

点赞 2

import org.spongepowered.api.world.gamerule.DefaultGameRules; //导入依赖的package包/类
private void setTime() {
	if (config == null)
		return;

	WorldProperties properties;
	final long worldTime = getWorldTime();

	for (World world : config.getActiveWorlds()) {
		properties = world.getWorldStorage().getWorldProperties();

		properties.setGameRule(DefaultGameRules.DO_DAYLIGHT_CYCLE, "false");
		properties.setWorldTime(worldTime);
	}
}
 

开发者ID:AuraDevelopmentTeam,
项目名称:AuraSunDial,
代码行数:15,
代码来源:AuraSunDial.java

示例3: init

点赞 2

import org.spongepowered.api.world.gamerule.DefaultGameRules; //导入依赖的package包/类
public static void init() {
    try {
        for (Field field : DefaultGameRules.class.getDeclaredFields()) {
            SpongeToMinecraft.put(CoreUtilities.toLowerCase(field.getName()), (String) field.get(null));
            MinecraftToSponge.put((String) field.get(null), CoreUtilities.toLowerCase(field.getName()));
        }
    }
    catch (IllegalAccessException e) {
        Denizen2Core.getImplementation().outputError("Failed to initialize the default game rules maps!");
        Denizen2Core.getImplementation().outputException(e);
    }
}
 

开发者ID:DenizenScript,
项目名称:Denizen2Sponge,
代码行数:13,
代码来源:GameRules.java

示例4: registerDefaults

点赞 2

import org.spongepowered.api.world.gamerule.DefaultGameRules; //导入依赖的package包/类
@Override
public void registerDefaults() {
   final ImmutableSet.Builder<String> builder = ImmutableSet.builder();
    for (Field field : DefaultGameRules.class.getFields()) {
        if (Modifier.isStatic(field.getModifiers()) && field.getType() == String.class) {
            try {
                builder.add((String) field.get(null));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    this.rules = builder.build();
    RuleTypes.init();
}
 

开发者ID:LanternPowered,
项目名称:LanternServer,
代码行数:16,
代码来源:DefaultGameRulesRegistryModule.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)