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


Java GameRules.addGameRule方法代码示例

本文整理汇总了Java中net.minecraft.world.GameRules.addGameRule方法的典型用法代码示例。如果您正苦于以下问题:Java GameRules.addGameRule方法的具体用法?Java GameRules.addGameRule怎么用?Java GameRules.addGameRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.GameRules的用法示例。


在下文中一共展示了GameRules.addGameRule方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerGameRules

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
public static void registerGameRules(GameRules rules){
	rules.addGameRule("tc_playDefaultMusic", "true", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disableInvokeSystem", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_visualEventDebugging", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disableTeleporter", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disableWeather", "false", GameRules.ValueType.BOOLEAN_VALUE);
	
	rules.addGameRule("tc_disable.damage.*", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.fall", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.drown", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.lava", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.magic", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.fire", "false", GameRules.ValueType.BOOLEAN_VALUE);
	rules.addGameRule("tc_disable.damage.suffocate", "false", GameRules.ValueType.BOOLEAN_VALUE);
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:16,代码来源:TaleCraftGameRules.java

示例2: createGameruleIfAbsent

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) {
    boolean added = false;
    if (!gameRule.hasRule(gameruleName)) {
        gameRule.addGameRule(gameruleName, Boolean.toString(value));
        added = true;
    }
    ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName));
    return added;
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:10,代码来源:DeathGamerules.java

示例3: serverStarting

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
@Override
public void serverStarting(FMLServerStartingEvent event, File configDirectory) {
    /* Add Custom GameRules */
    GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules();
    /* Add Does Campfire Burn GameRule: Only if not Present */
    String ruleName = "doesCampfireBurn";
    if (!gameRule.hasRule(ruleName)) {
        gameRule.addGameRule(ruleName, "false");
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:11,代码来源:ProjectZulu_Blocks.java

示例4: addRule

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
private void addRule(GameRules rules, String key, String val) {
	if (!rules.hasRule(key)) {
		rules.addGameRule(key, val);
	}
}
 
开发者ID:AlexDGr8r,项目名称:MeteorsMod,代码行数:6,代码来源:HandlerWorld.java

示例5: addRule

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
private static void addRule(GameRules rules, String name, String defaultValue) {
	if (!rules.hasRule(name)) rules.addGameRule(name, defaultValue, GameRules.ValueType.BOOLEAN_VALUE);
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:4,代码来源:GameRuleManager.java

示例6: initialize

import net.minecraft.world.GameRules; //导入方法依赖的package包/类
/**
 * Initializes the GameRule for a world.
 *
 * @param world The world to initialize for.
 */
public void initialize (World world) {

    final GameRules rules = world.getGameRules();

    if (!rules.hasRule(this.getId())) {

        rules.addGameRule(this.getId(), String.valueOf(this.getDefaultState()), ValueType.BOOLEAN_VALUE);
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Bookshelf,代码行数:15,代码来源:GameRule.java


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