Java Code Examples for net.minecraft.entity.player.EntityPlayer.getUniqueID()

The following are Jave code examples for showing how to use getUniqueID() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: MeeCreeps   File: ServerActionManager.java   Source Code and License Vote up 6 votes
public int createActionOptions(World world, BlockPos pos, EnumFacing side, @Nullable EntityPlayer player) {
    List<MeeCreepActionType> types = new ArrayList<>();
    List<MeeCreepActionType> maybeTypes = new ArrayList<>();
    for (MeeCreepsApi.Factory type : MeeCreeps.api.getFactories()) {
        if (Config.allowedActions.contains(type.getId())) {
            if (type.getFactory().isPossible(world, pos, side)) {
                types.add(new MeeCreepActionType(type.getId()));
            } else if (type.getFactory().isPossibleSecondary(world, pos, side)) {
                maybeTypes.add(new MeeCreepActionType(type.getId()));
            }
        }
    }
    int actionId = newId();
    ActionOptions opt = new ActionOptions(types, maybeTypes, pos, side, world.provider.getDimension(), player == null ? null : player.getUniqueID(), actionId);
    options.add(opt);
    optionMap.put(actionId, opt);
    save();
    return actionId;
}
 
Example 2
Project: ArcaneMagic   File: TileEntityAnalyzer.java   Source Code and License Vote up 5 votes
public void setPlayer(EntityPlayer player)
{
	if (player != null)
	{
		this.stackOwner = player.getUniqueID();
	} else
	{
		this.stackOwner = null;
	}
	markDirty();
}
 
Example 3
Project: EndermanEvolution   File: EntityFrienderman.java   Source Code and License Vote up 5 votes
private boolean shouldAttackPlayer(EntityPlayer player) {
	if (isTamed() && player.getUniqueID() == getOwnerId()) {
		return false;
	}
	if (getAttackingEntity() != null && getAttackingEntity() == player) {
		if (isTamed() && isSitting()) {
			setSitting(false);
		}
	}
	return getAttackingEntity() != null && getAttackingEntity() == player;
}
 
Example 4
Project: SerenityCE   File: AntiBot.java   Source Code and License Vote up 5 votes
public static boolean isBot(EntityPlayer entity) {
    if (entity.getUniqueID().toString().startsWith(entity.getCommandSenderName()))
        return true;
    if (!StringUtils.stripControlCodes(entity.getGameProfile().getName()).equals(entity.getCommandSenderName()))
        return true;
    if (entity.getGameProfile().getId() != entity.getUniqueID())
        return true;

    return false;
}
 
Example 5
Project: SerenityCE   File: BotDetector.java   Source Code and License Vote up 5 votes
public boolean isValid(EntityPlayer player) {
    boolean valid = isPlayerValid(player);

    UUID uuid = player.getUniqueID();
    boolean suspicious = !(pingUpdatedUUIDs.contains(uuid) || sneakUpdatedUUIDs.contains(uuid) || sprintUpdatedUUIDs.contains(uuid));

    return valid && !AntiBot.isBot(player) && !suspicious && onFloorUUIDs.contains(uuid);
}
 
Example 6
Project: WirelessCharger   File: TilePersonalCharger.java   Source Code and License Vote up 4 votes
public void setPlayer(EntityPlayer player) {
        playerUUID = player.getUniqueID();
        playerName = player.getName();
//        playerProfile = updateGameprofile(player.getGameProfile());
    }