Java 类net.minecraft.util.com.google.common.collect.Iterables 实例源码

项目:CraftBukkit    文件:TileEntitySkull.java   
private void d() {
    if (this.j != null && !UtilColor.b(this.j.getName())) {
        if (!this.j.isComplete() || !this.j.getProperties().containsKey("textures")) {
            GameProfile gameprofile = MinecraftServer.getServer().getUserCache().getProfile(this.j.getName());

            if (gameprofile != null) {
                Property property = (Property) Iterables.getFirst(gameprofile.getProperties().get("textures"), null);

                if (property == null) {
                    gameprofile = MinecraftServer.getServer().av().fillProfileProperties(gameprofile, true);
                }

                this.j = gameprofile;
                this.update();
            }
        }
    }
}
项目:EndHQ-Libraries    文件:RemotePlayer.java   
public void doActualSpawn(Location inLocation, GameProfile profile)
{
    Property property = Iterables.getFirst(profile.getProperties().get("textures"), null);
    if(property == null)
        profile = MinecraftServer.getServer().av().fillProfileProperties(profile, true);

    WorldServer worldServer = ((CraftWorld)inLocation.getWorld()).getHandle();

    this.m_entity = new RemotePlayerEntity(worldServer.getMinecraftServer(), worldServer, profile, new PlayerInteractManager(worldServer), this);
    worldServer.addEntity(m_entity);
    this.m_entity.world.players.remove(this.m_entity);
    Player player = this.getBukkitEntity();
    if(player != null)
    {
        player.teleport(inLocation);
        player.setMetadata("remoteentity", new FixedMetadataValue(this.m_manager.getPlugin(), this));
    }

    this.setHeadYaw(inLocation.getYaw());
    this.setYaw(inLocation.getYaw());
    ((RemotePlayerEntity)this.m_entity).updateSpawn();
    if(!inLocation.getBlock().getRelative(BlockFace.DOWN).isEmpty())
        this.m_entity.onGround = true;

    if(this.m_speed != -1)
        this.setSpeed(this.m_speed);
    else
        this.setSpeed(1d);

    if(this.m_speedModifier != null)
    {
        this.addSpeedModifier(this.m_speedModifier.d(), (this.m_speedModifier.c() == 0));
        this.m_speedModifier = null;
    }
}