Search in sources :

Example 36 with GameProfile

use of com.mojang.authlib.GameProfile in project PneumaticCraft by MineMaarten.

the class TileEntitySecurityStation method addHacker.

public void addHacker(GameProfile user) {
    for (GameProfile hackedUser : hackedUsers) {
        if (gameProfileEquals(hackedUser, user)) {
            return;
        }
    }
    for (GameProfile sharedUser : sharedUsers) {
        if (gameProfileEquals(sharedUser, user))
            return;
    }
    hackedUsers.add(user);
    sendDescriptionPacket();
}
Also used : GameProfile(com.mojang.authlib.GameProfile)

Example 37 with GameProfile

use of com.mojang.authlib.GameProfile in project Overloaded by CJ-MC-Mods.

the class BlockPlayerInterface method onBlockActivated.

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (!worldIn.isRemote && hand == EnumHand.MAIN_HAND) {
        TileEntity te = worldIn.getTileEntity(pos);
        if (te instanceof TilePlayerInterface) {
            UUID placer = ((TilePlayerInterface) te).getPlacer();
            GameProfile profile = worldIn.getMinecraftServer().getPlayerProfileCache().getProfileByUUID(placer);
            if (profile == null) {
                playerIn.sendMessage(new TextComponentString(String.format("Bound to offline player: %s", placer.toString())));
            } else {
                playerIn.sendMessage(new TextComponentString("Bound to player: " + profile.getName()));
            }
        }
    }
    return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TilePlayerInterface(com.cjm721.overloaded.block.tile.TilePlayerInterface) GameProfile(com.mojang.authlib.GameProfile) UUID(java.util.UUID) TextComponentString(net.minecraft.util.text.TextComponentString)

Example 38 with GameProfile

use of com.mojang.authlib.GameProfile in project Denizen-For-Bukkit by DenizenScript.

the class Handler_v1_8_R3 method getPlayerProfile.

@Override
public PlayerProfile getPlayerProfile(Player player) {
    GameProfile gameProfile = ((CraftPlayer) player).getProfile();
    Property property = Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
    return new PlayerProfile(gameProfile.getName(), gameProfile.getId(), property != null ? property.getValue() : null, property != null ? property.getSignature() : null);
}
Also used : GameProfile(com.mojang.authlib.GameProfile) PlayerProfile(net.aufdemrand.denizen.nms.util.PlayerProfile) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) Property(com.mojang.authlib.properties.Property)

Example 39 with GameProfile

use of com.mojang.authlib.GameProfile in project Denizen-For-Bukkit by DenizenScript.

the class BlockHelper_v1_8_R3 method getPlayerProfile.

@Override
public PlayerProfile getPlayerProfile(Skull skull) {
    GameProfile profile = ((CraftSkull) skull).getTileEntity().getGameProfile();
    if (profile == null) {
        return null;
    }
    String name = profile.getName();
    UUID id = profile.getId();
    Property property = Iterables.getFirst(profile.getProperties().get("textures"), null);
    return new PlayerProfile(name, id, property != null ? property.getValue() : null);
}
Also used : GameProfile(com.mojang.authlib.GameProfile) PlayerProfile(net.aufdemrand.denizen.nms.util.PlayerProfile) UUID(java.util.UUID) Property(com.mojang.authlib.properties.Property)

Example 40 with GameProfile

use of com.mojang.authlib.GameProfile in project Denizen-For-Bukkit by DenizenScript.

the class Handler_v1_9_R2 method getPlayerProfile.

@Override
public PlayerProfile getPlayerProfile(Player player) {
    GameProfile gameProfile = ((CraftPlayer) player).getProfile();
    Property property = Iterables.getFirst(gameProfile.getProperties().get("textures"), null);
    return new PlayerProfile(gameProfile.getName(), gameProfile.getId(), property != null ? property.getValue() : null, property != null ? property.getSignature() : null);
}
Also used : GameProfile(com.mojang.authlib.GameProfile) PlayerProfile(net.aufdemrand.denizen.nms.util.PlayerProfile) CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) Property(com.mojang.authlib.properties.Property)

Aggregations

GameProfile (com.mojang.authlib.GameProfile)60 Property (com.mojang.authlib.properties.Property)30 PlayerProfile (net.aufdemrand.denizen.nms.util.PlayerProfile)16 UUID (java.util.UUID)11 EntityPlayer (net.minecraft.entity.player.EntityPlayer)6 BigInteger (java.math.BigInteger)4 MessageDigest (java.security.MessageDigest)4 Player (com.minecolonies.api.colony.permissions.Player)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 WorldServer (net.minecraft.world.WorldServer)3 Scoreboard (org.bukkit.scoreboard.Scoreboard)3 Team (org.bukkit.scoreboard.Team)3 FakeDedicatedServer (com.builtbroken.mc.testing.junit.server.FakeDedicatedServer)2 TestPlayer (com.builtbroken.mc.testing.junit.testers.TestPlayer)2 File (java.io.File)2 NBTTagList (net.minecraft.nbt.NBTTagList)2 NBTTagString (net.minecraft.nbt.NBTTagString)2 NetHandlerPlayServer (net.minecraft.network.NetHandlerPlayServer)2 NetworkManager (net.minecraft.network.NetworkManager)2 PotionEffect (net.minecraft.potion.PotionEffect)2