本文整理汇总了Java中net.minecraft.network.play.server.S3EPacketTeams类的典型用法代码示例。如果您正苦于以下问题:Java S3EPacketTeams类的具体用法?Java S3EPacketTeams怎么用?Java S3EPacketTeams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
S3EPacketTeams类属于net.minecraft.network.play.server包,在下文中一共展示了S3EPacketTeams类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendScoreboard
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
protected void sendScoreboard(ServerScoreboard scoreboardIn, EntityPlayerMP playerIn)
{
Set<ScoreObjective> set = Sets.<ScoreObjective>newHashSet();
for (ScorePlayerTeam scoreplayerteam : scoreboardIn.getTeams())
{
playerIn.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0));
}
for (int i = 0; i < 19; ++i)
{
ScoreObjective scoreobjective = scoreboardIn.getObjectiveInDisplaySlot(i);
if (scoreobjective != null && !set.contains(scoreobjective))
{
for (Packet packet : scoreboardIn.func_96550_d(scoreobjective))
{
playerIn.playerNetServerHandler.sendPacket(packet);
}
set.add(scoreobjective);
}
}
}
示例2: update
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
public void update(){
int flags = 0;
if(this.friendlyFire) flags |= 0x1;
if(this.friendlyInvisiblesVisible) flags |= 0x2;
//TODO: visibility?
S3EPacketTeams packet = new S3EPacketTeams();
packet.field_149320_a = this.id;
packet.field_149318_b = this.displayName;
packet.field_149319_c = this.prefix;
packet.field_149316_d = this.suffix;
packet.field_149317_e = getPlayerNames();
packet.field_149314_f = 2; //Update
packet.field_149315_g = flags;
manager.sendPacket(packet);
}
示例3: addPlayerToTeam
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
/**
* Adds a player to the given team
*/
public boolean addPlayerToTeam(String player, String newTeam)
{
if (super.addPlayerToTeam(player, newTeam))
{
ScorePlayerTeam scoreplayerteam = this.getTeam(newTeam);
this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] {player}), 3));
this.func_96551_b();
return true;
}
else
{
return false;
}
}
示例4: removePlayerFromTeam
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
/**
* Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an
* IllegalStateException is thrown.
*/
public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_)
{
super.removePlayerFromTeam(p_96512_1_, p_96512_2_);
this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96512_2_, Arrays.asList(new String[] {p_96512_1_}), 4));
this.func_96551_b();
}
示例5: broadcastTeamCreated
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
/**
* This packet will notify the players that this team is created, and that will register it on the client
*/
public void broadcastTeamCreated(ScorePlayerTeam playerTeam)
{
super.broadcastTeamCreated(playerTeam);
this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(playerTeam, 0));
this.func_96551_b();
}
示例6: sendTeamUpdate
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
/**
* This packet will notify the players that this team is updated
*/
public void sendTeamUpdate(ScorePlayerTeam playerTeam)
{
super.sendTeamUpdate(playerTeam);
this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(playerTeam, 2));
this.func_96551_b();
}
示例7: func_96456_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
protected void func_96456_a(ServerScoreboard par1ServerScoreboard, EntityPlayerMP par2EntityPlayerMP)
{
HashSet var3 = new HashSet();
Iterator var4 = par1ServerScoreboard.getTeams().iterator();
while (var4.hasNext())
{
ScorePlayerTeam var5 = (ScorePlayerTeam)var4.next();
par2EntityPlayerMP.playerNetServerHandler.sendPacket(new S3EPacketTeams(var5, 0));
}
for (int var9 = 0; var9 < 3; ++var9)
{
ScoreObjective var10 = par1ServerScoreboard.func_96539_a(var9);
if (var10 != null && !var3.contains(var10))
{
List var6 = par1ServerScoreboard.func_96550_d(var10);
Iterator var7 = var6.iterator();
while (var7.hasNext())
{
Packet var8 = (Packet)var7.next();
par2EntityPlayerMP.playerNetServerHandler.sendPacket(var8);
}
var3.add(var10);
}
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:31,代码来源:ServerConfigurationManager.java
示例8: func_151392_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
public boolean func_151392_a(String p_151392_1_, String p_151392_2_)
{
if (super.func_151392_a(p_151392_1_, p_151392_2_))
{
ScorePlayerTeam var3 = this.getTeam(p_151392_2_);
this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(var3, Arrays.asList(new String[] {p_151392_1_}), 3));
this.func_96551_b();
return true;
}
else
{
return false;
}
}
示例9: removePlayerFromTeam
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
/**
* Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an
* IllegalStateException is thrown.
*/
public void removePlayerFromTeam(String par1Str, ScorePlayerTeam par2ScorePlayerTeam)
{
super.removePlayerFromTeam(par1Str, par2ScorePlayerTeam);
this.scoreboardMCServer.getConfigurationManager().func_148540_a(new S3EPacketTeams(par2ScorePlayerTeam, Arrays.asList(new String[] {par1Str}), 4));
this.func_96551_b();
}
示例10: func_96456_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
public void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_) // CraftBukkit - protected -> public
{
HashSet hashset = new HashSet();
Iterator iterator = p_96456_1_.getTeams().iterator();
while (iterator.hasNext())
{
ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)iterator.next();
p_96456_2_.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0));
}
for (int i = 0; i < 3; ++i)
{
ScoreObjective scoreobjective = p_96456_1_.func_96539_a(i);
if (scoreobjective != null && !hashset.contains(scoreobjective))
{
List list = p_96456_1_.func_96550_d(scoreobjective);
Iterator iterator1 = list.iterator();
while (iterator1.hasNext())
{
Packet packet = (Packet)iterator1.next();
p_96456_2_.playerNetServerHandler.sendPacket(packet);
}
hashset.add(scoreobjective);
}
}
}
示例11: func_151392_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
public boolean func_151392_a(String p_151392_1_, String p_151392_2_)
{
if (super.func_151392_a(p_151392_1_, p_151392_2_))
{
ScorePlayerTeam scoreplayerteam = this.getTeam(p_151392_2_);
this.sendAll(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] { p_151392_1_}), 3)); // CraftBukkit - Internal packet method
this.func_96551_b();
return true;
}
else
{
return false;
}
}
示例12: func_96456_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
protected void func_96456_a(ServerScoreboard p_96456_1_, EntityPlayerMP p_96456_2_)
{
HashSet hashset = new HashSet();
Iterator iterator = p_96456_1_.getTeams().iterator();
while (iterator.hasNext())
{
ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)iterator.next();
p_96456_2_.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0));
}
for (int i = 0; i < 3; ++i)
{
ScoreObjective scoreobjective = p_96456_1_.func_96539_a(i);
if (scoreobjective != null && !hashset.contains(scoreobjective))
{
List list = p_96456_1_.func_96550_d(scoreobjective);
Iterator iterator1 = list.iterator();
while (iterator1.hasNext())
{
Packet packet = (Packet)iterator1.next();
p_96456_2_.playerNetServerHandler.sendPacket(packet);
}
hashset.add(scoreobjective);
}
}
}
示例13: func_151392_a
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
public boolean func_151392_a(String p_151392_1_, String p_151392_2_)
{
if (super.func_151392_a(p_151392_1_, p_151392_2_))
{
ScorePlayerTeam scoreplayerteam = this.getTeam(p_151392_2_);
this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] {p_151392_1_}), 3));
this.func_96551_b();
return true;
}
else
{
return false;
}
}
示例14: addPlayer
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
@Override
public boolean addPlayer(Player player) {
Checks.notNull(player, "player may not be null");
if(players.add(player)){
S3EPacketTeams packet = new S3EPacketTeams();
packet.field_149320_a = id;
packet.field_149317_e = getPlayerNames();
packet.field_149314_f = 3; //Add Player
manager.sendPacket(packet);
return true;
}else{
return false;
}
}
示例15: removePlayer
import net.minecraft.network.play.server.S3EPacketTeams; //导入依赖的package包/类
@Override
public boolean removePlayer(Player player) {
Checks.notNull(player, "player may not be null");
if(players.remove(player)){
S3EPacketTeams packet = new S3EPacketTeams();
packet.field_149320_a = id;
packet.field_149317_e = getPlayerNames();
packet.field_149314_f = 4; //Remove Player
manager.sendPacket(packet);
return true;
}else{
return false;
}
}