Package com.mojang.authlib

Examples of com.mojang.authlib.GameProfile


    isOwnable = ordinal >= 0;
    if (isOwnable) {
      access = EnumAccess.values()[ordinal];

      if (data.readBoolean()) {
        owner = new GameProfile(new UUID(data.readLong(), data.readLong()), data.readUTF());
      } else {
        owner = null;
      }
    }
View Full Code Here


    for (Field member : enumMember) {
      intPayload[index.intIndex] = ((Enum) member.get(obj)).ordinal();
      index.intIndex++;
    }
    for (Field member : gameProfileMember) {
      GameProfile profile = (GameProfile) member.get(obj);
      UUID profileID = profile.getId();
      if (profileID == null)
        profileID = new UUID(0,0);
      intPayload[index.intIndex] = (int) profileID.getMostSignificantBits() >>> 32;
      intPayload[index.intIndex + 1] = (int) profileID.getMostSignificantBits();
      intPayload[index.intIndex + 2] = (int) profileID.getLeastSignificantBits() >>> 32;
      intPayload[index.intIndex + 3] = (int) profileID.getLeastSignificantBits();
      index.intIndex += 4;
      stringPayload[index.stringIndex] = profile.getName();
      index.stringIndex++;
    }

    // Handle subobjects
    for (ClassMap submap : objectMember) {
View Full Code Here

    for (Field member : stringMember) {
      member.set(obj, stringPayload[index.stringIndex]);
      index.stringIndex++;
    }
    for (Field member : gameProfileMember) {
      GameProfile profile = new GameProfile(new UUID((long) intPayload[index.intIndex] << 32 | intPayload[index.intIndex + 1],
          (long) intPayload[index.intIndex + 2] << 32 | intPayload[index.intIndex + 3]),
          stringPayload[index.stringIndex]);
      index.intIndex += 4;
      index.stringIndex++;
View Full Code Here

import com.mojang.authlib.GameProfile;

public class FakePlayer extends EntityPlayer {

  public FakePlayer(TileEntity from) {
    super(from.getWorldObj(), new GameProfile(null, "[LogisticsPipes]"));
    posX = from.xCoord;
    posY = from.yCoord + 1;
    posZ = from.zCoord;
  }
View Full Code Here

    @Override
    public boolean canPlayerEdit(EntityPlayer player, ItemStack stack) {
        boolean canEdit = PlayerPlugin.isPlayerOp(player.getGameProfile());
        if (!canEdit && !RailcraftConfig.isRoutingOpsOnly()) {
            GameProfile owner = getOwner(stack);
            canEdit |= owner.getId() == null || owner.equals(player.getCommandSenderName());
        }
        return canEdit;
    }
View Full Code Here

  }

  @Override
  public String getItemStackDisplayName(ItemStack is)
  {
    GameProfile username = getProfile( is );
    return username != null ? super.getItemStackDisplayName( is ) + " - " + username.getName() : super.getItemStackDisplayName( is );
  }
View Full Code Here

    return is;
  }

  private void encode(ItemStack is, EntityPlayer p)
  {
    GameProfile username = getProfile( is );
   
    if (username != null && username.equals(p.getGameProfile()))
      setProfile( is, null );
    else
      setProfile( is, p.getGameProfile() );
  }
View Full Code Here

    float v = ExtraItemTextures.White.getIcon().getInterpolatedV( 8.1 );

    String username = "";
    if ( item.getItem() instanceof IBiometricCard )
    {
      GameProfile gp = (( IBiometricCard) item.getItem() ).getProfile(item);
      if ( gp != null )
        username = gp.getName();
    }
    int hash = username.length() > 0 ? username.hashCode() : 0;

    GL11.glScalef( 1F / 16F, 1F / 16F, 1F );
    GL11.glTranslatef( 4, 6, 0 );
View Full Code Here

  public boolean canAccept(IAEItemStack input)
  {
    if ( input.getItem() instanceof IBiometricCard )
    {
      IBiometricCard tbc = (IBiometricCard) input.getItem();
      GameProfile newUser = tbc.getProfile( input.getItemStack() );

      int PlayerID = AEApi.instance().registries().players().getID( newUser );
      if ( securityTile.getOwner() == PlayerID )
        return false;

      for (IAEItemStack ais : storedItems)
      {
        if ( ais.isMeaningful() )
        {
          GameProfile thisUser = tbc.getProfile( ais.getItemStack() );
          if ( thisUser == newUser )
            return false;
         
          if ( thisUser != null && thisUser.equals( newUser ) )
            return false;
        }
      }

      return true;
View Full Code Here

        return PlayerPlugin.isOwnerOrOp(getOwner(ticket), player);
    }

    public static GameProfile getOwner(ItemStack ticket) {
        if (ticket == null || !(ticket.getItem() instanceof ItemTicket))
            return new GameProfile(null, "[Unknown]");
        NBTTagCompound nbt = ticket.getTagCompound();
        if (nbt == null)
            return new GameProfile(null, "[Unknown]");
        return PlayerPlugin.readOwnerFromNBT(nbt);
    }
View Full Code Here

TOP

Related Classes of com.mojang.authlib.GameProfile

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.