Exemplo n.º 1
0
	@Override
	public User getOfflineUser(final String name)
	{
		final User user = userMap.getUser(name);
		if (user != null && user.getBase() instanceof OfflinePlayer)
		{
			((OfflinePlayer)user.getBase()).setName(name);
		}
		return user;
	}
Exemplo n.º 2
0
	@Override
	public User getUser(final Object base)
	{
		if (base instanceof Player)
		{
			return getUser((Player)base);
		}
		if (base instanceof String)
		{
			final User user = userMap.getUser((String)base);
			if (user != null && user.getBase() instanceof OfflinePlayer)
			{
				((OfflinePlayer)user.getBase()).setName((String)base);
			}
			return user;
		}
		return null;
	}
Exemplo n.º 3
0
	private <T extends Player> User getUser(final T base)
	{
		if (base == null)
		{
			return null;
		}

		if (base instanceof User)
		{
			return (User)base;
		}
		User user = userMap.getUser(base.getName());

		if (user == null)
		{
			user = new User(base, this);
		}
		else
		{
			user.update(base);
		}
		return user;
	}