Package com.mojang.authlib

Examples of com.mojang.authlib.GameProfile


     */
    @SideOnly(Side.CLIENT)
    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
        if (stack.hasTagCompound()) {
            GameProfile owner = getOwner(stack);
            if (owner.getId() != null) {
                list.add(EnumChatFormatting.WHITE + LocalizationPlugin.translate("railcraft.gui.routing.ticket.tip.issuer"));
                list.add(EnumChatFormatting.GRAY + PlayerPlugin.getUsername(player.worldObj, owner));
            }

            String dest = getDestination(stack);
View Full Code Here


        return renderer.getItemIcons()[pass];
    }

    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List info, boolean adv) {
        GameProfile owner = getOwner(stack);
        if (owner.getName() != null && !owner.getName().equals("[Unknown]")) {
            String format = LocalizationPlugin.translate("railcraft.gui.locomotive.tip.item.owner");
            info.add(String.format(format, owner.getName()));
        }

        String model = getModel(stack);
        LocomotiveModelRenderer renderer = renderType.getRenderer(model);
        String modelName;
View Full Code Here

    }

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

        if (nbt.hasKey("owner"))
            ownerName = nbt.getString("owner");
        UUID ownerUUID = null;
        if (nbt.hasKey("ownerId"))
            ownerUUID = UUID.fromString(nbt.getString("ownerId"));
        return new GameProfile(ownerUUID, ownerName);
    }
View Full Code Here

        sharedUsers.clear();
        NBTTagList sharedList = tag.getTagList("SharedUsers", 10);
        for(int i = 0; i < sharedList.tagCount(); ++i) {
            NBTTagCompound tagCompound = sharedList.getCompoundTagAt(i);
            sharedUsers.add(new GameProfile(tagCompound.hasKey("uuid") ? UUID.fromString(tagCompound.getString("uuid")) : null, tagCompound.getString("name")));
        }

        hackedUsers.clear();
        NBTTagList hackedList = tag.getTagList("HackedUsers", 10);
        for(int i = 0; i < hackedList.tagCount(); ++i) {
            NBTTagCompound tagCompound = hackedList.getCompoundTagAt(i);
            hackedUsers.add(new GameProfile(tagCompound.hasKey("uuid") ? UUID.fromString(tagCompound.getString("uuid")) : null, tagCompound.getString("name")));
        }

        checkForNetworkValidity();
    }
View Full Code Here

        return rebootTimer > 0 || isPlayerOnWhiteList(player) || hasPlayerHacked(player);
    }

    public boolean isPlayerOnWhiteList(EntityPlayer player){
        for(int i = 0; i < sharedUsers.size(); i++) {
            GameProfile user = sharedUsers.get(i);
            if(gameProfileEquals(user, player.getGameProfile())) {
                if(user.getId() == null && player.getGameProfile().getId() != null) {
                    sharedUsers.set(i, player.getGameProfile());
                    Log.info("Legacy conversion: Security Station shared username '" + player.getCommandSenderName() + "' is now using UUID '" + player.getGameProfile().getId() + "'.");
                }
                return true;
            }
View Full Code Here

        return false;
    }

    public boolean hasPlayerHacked(EntityPlayer player){
        for(int i = 0; i < hackedUsers.size(); i++) {
            GameProfile user = hackedUsers.get(i);
            if(gameProfileEquals(user, player.getGameProfile())) {
                if(user.getId() == null && player.getGameProfile().getId() != null) {
                    hackedUsers.set(i, player.getGameProfile());
                    Log.info("Legacy conversion: Security Station hacked username '" + player.getCommandSenderName() + "' is now using UUID '" + player.getGameProfile().getId() + "'.");
                }
                return true;
            }
View Full Code Here

    }

    @Override
    protected void handleServerSide(TileEntity te, String profile){
        if(te instanceof TileEntitySecurityStation) {
            ((TileEntitySecurityStation)te).addHacker(new GameProfile(null, profile));
        }
    }
View Full Code Here

    }

    @Override
    protected void handleServerSide(TileEntity te, String profile){
        if(te instanceof TileEntitySecurityStation) {
            ((TileEntitySecurityStation)te).addSharedUser(new GameProfile(null, profile));
        }
    }
View Full Code Here

        this(world);
        initializeFakePlayer(world, player.getGameProfile().getId().toString(), player.getCommandSenderName());
    }

    private void initializeFakePlayer(World world, String uuid, String name){
        fakePlayer = new DroneFakePlayer((WorldServer)world, new GameProfile(uuid != null ? UUID.fromString(uuid) : null, name), new FakePlayerItemInWorldManager(world, fakePlayer, this));
        fakePlayer.playerNetServerHandler = new NetHandlerPlayServer(MinecraftServer.getServer(), new NetworkManager(false), fakePlayer);
        fakePlayer.inventory = new InventoryFakePlayer(fakePlayer);
        playerName = name;
    }
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.