Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Configure Google Cloud credentials
uses: google-github-actions/auth@v1
with:
workload_identity_provider: 'projects/271010089174/locations/global/workloadIdentityPools/github/providers/github-oidc'
service_account: 'github-actions@moonsworth-299m4oir.iam.gserviceaccount.com'
workload_identity_provider: 'projects/266324743316/locations/global/workloadIdentityPools/github/providers/github-oidc'
service_account: 'github-actions@mw-lunarclient-maven-repo.iam.gserviceaccount.com'

- name: Setup Java
uses: actions/setup-java@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* This file is part of Apollo, licensed under the MIT License.
*
* Copyright (c) 2023 Moonsworth
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.event.pingmarker;

import com.lunarclient.apollo.common.location.ApolloLocation;
import com.lunarclient.apollo.event.EventCancellable;
import com.lunarclient.apollo.module.pingmarker.PingMarkerType;
import com.lunarclient.apollo.player.ApolloPlayer;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.experimental.FieldDefaults;
import lombok.experimental.NonFinal;
import org.jetbrains.annotations.Nullable;

/**
* Represents an event that is fired when the player requests a ping marker.
*
* @since 1.1.9
*/
@Getter
@RequiredArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
public final class ApolloPlayerRequestMarkerEvent implements EventCancellable {

/**
* The player sending the ping request.
*
* @return the source player
* @since 1.1.9
*/
ApolloPlayer player;

/**
* The {@link PingMarkerType} for this request.
*
* @return the ping marker type
* @since 1.1.9
*/
@Nullable PingMarkerType type;

/**
* The source {@link ApolloLocation} for this request.
*
* @return the source location
* @since 1.1.9
*/
ApolloLocation source;

/**
* The target {@link ApolloLocation} for this request.
*
* @return the target location
* @since 1.1.9
*/
ApolloLocation target;

@NonFinal @Setter boolean cancelled;

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ public boolean isClientNotify() {
/**
* Overrides the glow effect for the glowingPlayer, visible by the viewers.
*
* <p>If no color is specified, the glowing color will match the player's scoreboard team color.</p>
*
*
* @param recipients the recipients that are receiving the packet
* @param glowingPlayer the UUID of the player whose glowing effect will be overwrote
* @since 1.1.9
*/
public abstract void overrideGlow(Recipients recipients, UUID glowingPlayer);

/**
* Overrides the glow effect for the glowingPlayer, visible by the viewers.
*
* <p>If the {@code color} parameter is {@code null}, the glowing color will match the player's scoreboard team color.</p>
*
* @param recipients the recipients that are receiving the packet
* @param glowingPlayer the UUID of the player whose glowing effect will be overwrote
* @param color the new color glowingPlayer should glow in.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* This file is part of Apollo, licensed under the MIT License.
*
* Copyright (c) 2023 Moonsworth
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.module.pingmarker;

import com.lunarclient.apollo.common.icon.Icon;
import com.lunarclient.apollo.common.location.ApolloLocation;
import java.awt.Color;
import java.time.Duration;
import java.util.UUID;
import lombok.Builder;
import lombok.Getter;
import org.jetbrains.annotations.Nullable;

/**
* Represents a ping marker which can be shown on the client.
*
* @since 1.1.9
*/
@Getter
@Builder
public final class PingMarker {

/**
* Returns the marker {@link UUID}.
*
* @return the ping marker id
* @since 1.1.9
*/
UUID id;

/**
* Returns the {@link PingMarkerType}.
*
* @return the ping marker type
* @since 1.1.9
*/
@Nullable PingMarkerType type;

/**
* Returns the marker {@link ApolloLocation}.
*
* @return the ping marker location
* @since 1.1.9
*/
ApolloLocation location;

/**
* Returns the marker {@link Color}.
*
* @return the ping marker color
* @since 1.1.9
*/
Color color;

/**
* Returns the marker {@link Duration}.
*
* @return the ping marker duration
* @since 1.1.9
*/
Duration duration;

/**
* Returns whether the marker should animate.
*
* @return the ping marker focus state
* @since 1.1.9
*/
boolean focus;

/**
* Returns the ping marker {@link Icon}.
*
* <p>Can be any of the icons found in {@link com.lunarclient.apollo.common.icon} package,
* for the most common use case, use {@link com.lunarclient.apollo.common.icon.ItemStackIcon}.</p>
*
* @return the ping marker icon
* @since 1.1.9
*/
Icon icon;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* This file is part of Apollo, licensed under the MIT License.
*
* Copyright (c) 2023 Moonsworth
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.module.pingmarker;

import com.lunarclient.apollo.module.ApolloModule;
import com.lunarclient.apollo.module.ModuleDefinition;
import com.lunarclient.apollo.recipients.Recipients;
import java.util.UUID;
import org.jetbrains.annotations.ApiStatus;

/**
* Represents the ping marker module.
*
* @since 1.1.9
*/
@ApiStatus.NonExtendable
@ModuleDefinition(id = "ping_marker", name = "Ping Marker")
public abstract class PingMarkerModule extends ApolloModule {

/**
* Sends the {@link PingMarkerType} to the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param type the marker type
* @since 1.1.9
*/
public abstract void setMarkerType(Recipients recipients, PingMarkerType type);

/**
* Removes the {@link PingMarkerType} from the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param name the marker type name
* @since 1.1.9
*/
public abstract void removeMarkerType(Recipients recipients, String name);

/**
* Removes the {@link PingMarkerType} from the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param type the marker type
* @since 1.1.9
*/
public abstract void removeMarkerType(Recipients recipients, PingMarkerType type);

/**
* Resets all {@link PingMarkerType}s for the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @since 1.1.9
*/
public abstract void resetMarkerType(Recipients recipients);

/**
* Displays the {@link PingMarker} to the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param marker the marker
* @since 1.1.9
*/
public abstract void displayMarker(Recipients recipients, PingMarker marker);

/**
* Removes the {@link PingMarker} from the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param markerId the marker id
* @since 1.1.9
*/
public abstract void removeMarker(Recipients recipients, UUID markerId);

/**
* Removes the {@link PingMarker} from the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @param marker the marker
* @since 1.1.9
*/
public abstract void removeMarker(Recipients recipients, PingMarker marker);

/**
* Resets all {@link PingMarker}s for the {@link Recipients}.
*
* @param recipients the recipients that are receiving the packet
* @since 1.1.9
*/
public abstract void resetMarkers(Recipients recipients);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* This file is part of Apollo, licensed under the MIT License.
*
* Copyright (c) 2023 Moonsworth
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.module.pingmarker;

import com.lunarclient.apollo.common.icon.Icon;
import lombok.Builder;
import lombok.Getter;

/**
* Represents a ping marker type which can be shown on the client.
*
* @since 1.1.9
*/
@Getter
@Builder
public final class PingMarkerType {

/**
* Returns the ping marker type {@link String} name.
*
* @return the ping marker type name
* @since 1.1.9
*/
String name;

/**
* Returns the ping marker {@link Icon}.
*
* <p>Can be any of the icons found in {@link com.lunarclient.apollo.common.icon} package,
* for the most common use case, use {@link com.lunarclient.apollo.common.icon.ItemStackIcon}.</p>
*
* @return the ping marker icon
* @since 1.1.9
*/
Icon icon;

}
Loading