Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
feat: ✨ add removeAllTeammates method
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardDorian committed Feb 16, 2022
1 parent 30f354d commit fed3181
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/LCPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class LCPlayer {
return true;
}

removeAllTeammates() {
this.teammates = [];
this.#sendTeammateList();
}

#sendTeammateList() {
const players = [];
this.teammates.forEach((uuid) => {
Expand Down
11 changes: 6 additions & 5 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ export declare class LCPlayer {
* @param client Node Minecraft Protocol Client
* @param channel LC Plugin Channel to use
*/
constructor(
client: Client,
channel: 'lunarclient:pm' | 'Lunar-Client' = 'lunarclient:pm'
);
constructor(client: Client, channel?: 'lunarclient:pm' | 'Lunar-Client');

/**
* Node Minecraft Protocol Client
Expand Down Expand Up @@ -60,7 +57,7 @@ export declare class LCPlayer {
sendNotification(
message: string,
durationMs: number,
level: 'error' | 'info' | 'success' | 'warning' = 'info'
level?: 'error' | 'info' | 'success' | 'warning'
): void;
/**
* Add a teammate to the client. The TeamView mod must be enabled for this to work.
Expand All @@ -74,6 +71,10 @@ export declare class LCPlayer {
* @returns True if successful
*/
removeTeammate(uuid: string): boolean;
/**
* Remove all teammates from the client. The TeamView mod must be enabled for this to work.
*/
removeAllTeammates(): void;
}

/**
Expand Down

0 comments on commit fed3181

Please sign in to comment.