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