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


Java ScorePlayerTeam.setSeeFriendlyInvisiblesEnabled方法代码示例

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


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

示例1: loadWorld

import net.minecraft.scoreboard.ScorePlayerTeam; //导入方法依赖的package包/类
@SubscribeEvent
public void loadWorld(WorldEvent.Load event) {
	/*if (!event.getWorld().isRemote && event.getWorld().getPerWorldStorage().getOrLoadData(TF2WorldStorage.class, TF2weapons.MOD_ID)==null){
		event.getWorld().getPerWorldStorage().setData(TF2weapons.MOD_ID, new TF2WorldStorage());
		dummyEnt = new EntityCreeper(null);
	}*/
	TF2weapons.dummyEnt = new EntityCreeper(event.getWorld());
	if(!event.getWorld().getGameRules().hasRule("doTF2AI"))
		event.getWorld().getGameRules().addGameRule("doTF2AI", "true", ValueType.BOOLEAN_VALUE);
	if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("RED") == null) {
		ScorePlayerTeam teamRed = event.getWorld().getScoreboard().createTeam("RED");
		ScorePlayerTeam teamBlu = event.getWorld().getScoreboard().createTeam("BLU");

		teamRed.setSeeFriendlyInvisiblesEnabled(true);
		teamRed.setAllowFriendlyFire(false);
		teamBlu.setSeeFriendlyInvisiblesEnabled(true);
		teamBlu.setAllowFriendlyFire(false);
		teamRed.setPrefix(TextFormatting.RED.toString());
		teamBlu.setPrefix(TextFormatting.BLUE.toString());
		teamRed.setColor(TextFormatting.RED);
		teamBlu.setColor(TextFormatting.BLUE);
		event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamRed);
		event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamBlu);

	}
	if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("TF2Bosses") == null) {
		ScorePlayerTeam teamBosses = event.getWorld().getScoreboard().createTeam("TF2Bosses");
		teamBosses.setSeeFriendlyInvisiblesEnabled(true);
		teamBosses.setAllowFriendlyFire(false);
		teamBosses.setPrefix(TextFormatting.DARK_PURPLE.toString());
		teamBosses.setColor(TextFormatting.DARK_PURPLE);
		event.getWorld().getScoreboard().broadcastTeamInfoUpdate(teamBosses);
	}
	if (!event.getWorld().isRemote && event.getWorld().getScoreboard().getTeam("RED").getColor() == TextFormatting.RESET) {
		event.getWorld().getScoreboard().getTeam("RED").setColor(TextFormatting.RED);
		event.getWorld().getScoreboard().getTeam("BLU").setColor(TextFormatting.BLUE);
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:39,代码来源:TF2EventsCommon.java


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