Package com.flansmod.common

Examples of com.flansmod.common.PlayerData


  public void displayVotingGUI()
  {
   
    for(EntityPlayer player : getPlayers())
    {
      PlayerData data = PlayerHandler.getPlayerData(player);
      if(!data.builder)
        sendPacketToPlayer(new PacketVoting(this), (EntityPlayerMP)player);
    }
  }
View Full Code Here


 
  public void showTeamsMenuToAll(boolean info)
  {
    for(EntityPlayer player : getPlayers())
    {
      PlayerData data = PlayerHandler.getPlayerData(player);
      //Catch for broken player data
      if(data == null)
        continue;
      //Catch for people not on a team, such as builders
      if(data.builder && playerIsOp(player))
View Full Code Here

    if(!enabled || currentRound == null)
      return;
    if(event.entity instanceof EntityPlayerMP)
    {
      EntityPlayerMP player = (EntityPlayerMP)event.entity;
      PlayerData data = PlayerHandler.getPlayerData(player);
      DamageSource source = event.source;
     
      if(data.team == Team.spectators && source != DamageSource.generic)
      {
        event.setCanceled(true);
        return;
      }
     
      if(source instanceof EntityDamageSource && source.getEntity() instanceof EntityPlayerMP)
      {
        EntityPlayerMP attacker = ((EntityPlayerMP) source.getEntity());
        PlayerData attackerData = PlayerHandler.getPlayerData(attacker);
       
        if(attackerData == null)
          return;
       
        //Can hurt self
View Full Code Here

  public void playerLoot(EntityItemPickupEvent event)
  {
    if(event.entity instanceof EntityPlayer)
    {
      ItemStack itemStack = event.item.getEntityItem();
      PlayerData data = PlayerHandler.getPlayerData(event.entityPlayer);
      if(enabled && currentRound != null && data != null)
      {
        if(data.team == Team.spectators || !currentRound.gametype.playerCanLoot(itemStack, InfoType.getType(itemStack), event.entityPlayer, data.team))
          event.setCanceled(true);
      }
View Full Code Here

   
    if(!enabled || currentRound == null)
      return;
   
    EntityPlayerMP playerMP = ((EntityPlayerMP)player);
    PlayerData data = PlayerHandler.getPlayerData(playerMP);
   
    if(data == null || (data.builder && playerIsOp(playerMP)))
      return;
   
    //On the first spawn, we don't kill the player, we simply move them over, so do a /tp like command
View Full Code Here

  private void setPlayersNextSpawnpoint(EntityPlayerMP player)
  {
    if(!enabled || currentRound == null)
      return;
   
    PlayerData data = PlayerHandler.getPlayerData(player);

    Vec3 spawnPoint = currentRound.gametype.getSpawnPoint(player);
    if(spawnPoint != null)
      setPlayersNextSpawnpoint(player, new ChunkCoordinates(MathHelper.floor_double(spawnPoint.xCoord), MathHelper.floor_double(spawnPoint.yCoord) + 1, MathHelper.floor_double(spawnPoint.zCoord)));
    else
View Full Code Here

  public void playerSelectedTeam(EntityPlayerMP player, String teamName)
  {
    if(!enabled || currentRound == null)
      return;
   
    PlayerData data = PlayerHandler.getPlayerData(player);
   
    data.builder = false;
   
    //The player picked the op / builder team
    if(teamName.equals("null"))
View Full Code Here

  public void playerSelectedClass(EntityPlayerMP player, String className)
  {
    if(!enabled || currentRound == null)
      return;
   
    PlayerData data = PlayerHandler.getPlayerData(player);
   
    //Get player class requested
    PlayerClass playerClass = PlayerClass.getClass(className);
    //Validate class
    if(!data.newTeam.classes.contains(playerClass))
View Full Code Here

  }

  @Override
  public void handleServerSide(EntityPlayerMP playerEntity)
  {
    PlayerData data = PlayerHandler.getPlayerData(playerEntity, Side.SERVER);
    data.offHandGunSlot = slot;
   
    FlansMod.getPacketHandler().sendToAllAround(new PacketOffHandGunInfo(playerEntity, slot), playerEntity.posX, playerEntity.posY, playerEntity.posZ, 50F, playerEntity.dimension);
  }
View Full Code Here

    if(vote < 0 || vote > TeamsManager.getInstance().voteOptions.length)
    {
      FlansMod.log("Invalid vote " + vote + " from " + playerEntity.getCommandSenderName());
      return;
    }
    PlayerData data = PlayerHandler.getPlayerData(playerEntity, Side.SERVER);
    data.vote = vote;
  }
View Full Code Here

TOP

Related Classes of com.flansmod.common.PlayerData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.