Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNature committed Oct 28, 2024
2 parents 2ae4dd0 + 634813e commit ac5d48a
Show file tree
Hide file tree
Showing 197 changed files with 10,667 additions and 894 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Apollo
![Build Status](https://img.shields.io/github/actions/workflow/status/LunarClient/Apollo/.github/workflows/deploy.yml)
[![Discord](https://img.shields.io/discord/1080556677004271666?logo=discord&label=discord)](https://discord.gg/3T9Atyb6pf)

Apollo is a powerful tool that allows developers to create custom integrations with Lunar Client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.UUID;
import net.kyori.adventure.audience.ForwardingAudience;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;

/**
* Represents a player on Apollo.
Expand Down Expand Up @@ -111,37 +112,36 @@ default boolean hasPermission(Options options, Option<String, ?, ?> option) {
*/
Object getPlayer();

// TODO: nullable or optional?
/**
* Returns the {@link MinecraftVersion} the player is running.
*
* @return the minecraft version
* @since 1.1.5
*/
MinecraftVersion getMinecraftVersion();
@Nullable MinecraftVersion getMinecraftVersion();

/**
* Returns the {@link LunarClientVersion} the player is running.
*
* @return the lunar client version
* @since 1.1.5
*/
LunarClientVersion getLunarClientVersion();
@Nullable LunarClientVersion getLunarClientVersion();

/**
* Returns a {@link List} of {@link LunarClientMod} the player has installed.
*
* @return the installed mods
* @since 1.1.5
*/
List<LunarClientMod> getInstalledMods();
@Nullable List<LunarClientMod> getInstalledMods();

/**
* Returns the {@link TebexEmbeddedCheckoutSupport} type.
*
* @return the Tebex checkout support type
* @since 1.1.5
*/
TebexEmbeddedCheckoutSupport getTebexEmbeddedCheckoutSupport();
@Nullable TebexEmbeddedCheckoutSupport getTebexEmbeddedCheckoutSupport();

}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example;
package com.lunarclient.apollo.example.api;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.module.border.BorderModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.common.location.ApolloBlockLocation;
import com.lunarclient.apollo.example.common.modules.impl.BeamExample;
import com.lunarclient.apollo.module.beam.Beam;
import com.lunarclient.apollo.module.beam.BeamModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import java.awt.Color;
import java.util.Optional;
import org.bukkit.entity.Player;

public class BeamExample {
public class BeamApiExample extends BeamExample {

private final BeamModule beamModule = Apollo.getModuleManager().getModule(BeamModule.class);

@Override
public void displayBeamExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -55,11 +57,13 @@ public void displayBeamExample(Player viewer) {
});
}

@Override
public void removeBeamExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.beamModule.removeBeam(apolloPlayer, "spawn-beacon"));
}

@Override
public void resetBeamsExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.beamModule::resetBeams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,23 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.common.cuboid.Cuboid2D;
import com.lunarclient.apollo.example.common.modules.impl.BorderExample;
import com.lunarclient.apollo.module.border.Border;
import com.lunarclient.apollo.module.border.BorderModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import java.awt.Color;
import java.util.Optional;
import org.bukkit.entity.Player;

public class BorderExample {
public class BorderApiExample extends BorderExample {

private final BorderModule borderModule = Apollo.getModuleManager().getModule(BorderModule.class);

@Override
public void displayBorderExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -60,11 +62,13 @@ public void displayBorderExample(Player viewer) {
});
}

@Override
public void removeBorderExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.borderModule.removeBorder(apolloPlayer, "pvp-tagged-spawn"));
}

@Override
public void resetBordersExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.borderModule::resetBorders);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,37 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.example.common.modules.impl.ChatExample;
import com.lunarclient.apollo.module.chat.ChatModule;
import com.lunarclient.apollo.recipients.Recipients;
import java.util.concurrent.ThreadLocalRandom;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

public class ChatExample {
public class ChatApiExample extends ChatExample {

private final ChatModule chatModule = Apollo.getModuleManager().getModule(ChatModule.class);

private final int messageId = ThreadLocalRandom.current().nextInt(100);
private int countdown = 5;

@Override
public void displayLiveChatMessageExample() {
this.chatModule.displayLiveChatMessage(Recipients.ofEveryone(),
Component.text("Game starting in ", NamedTextColor.GREEN)
.append(Component.text(this.countdown, NamedTextColor.BLUE)),
this.messageId
13
);

if (--this.countdown == 0) {
this.countdown = 5;
}
}

@Override
public void removeLiveChatMessageExample() {
this.chatModule.removeLiveChatMessage(Recipients.ofEveryone(), this.messageId);
this.chatModule.removeLiveChatMessage(Recipients.ofEveryone(), 13);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.example.common.modules.impl.ColoredFireExample;
import com.lunarclient.apollo.module.coloredfire.ColoredFireModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import com.lunarclient.apollo.recipients.Recipients;
Expand All @@ -32,21 +33,24 @@
import java.util.UUID;
import org.bukkit.entity.Player;

public class ColoredFireExample {
public class ColoredFireApiExample extends ColoredFireExample {

private final ColoredFireModule coloredFireModule = Apollo.getModuleManager().getModule(ColoredFireModule.class);

@Override
public void overrideColoredFireExample(UUID burningPlayer) {
this.coloredFireModule.overrideColoredFire(Recipients.ofEveryone(),
burningPlayer,
Color.BLUE
);
}

@Override
public void resetColoredFireExample(UUID burningPlayer) {
this.coloredFireModule.resetColoredFire(Recipients.ofEveryone(), burningPlayer);
}

@Override
public void resetColoredFiresExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.coloredFireModule::resetColoredFires);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.example.common.modules.impl.CombatExample;
import com.lunarclient.apollo.module.combat.CombatModule;

public class CombatExample {
public class CombatApiExample extends CombatExample {

private final CombatModule combatModule = Apollo.getModuleManager().getModule(CombatModule.class);

@Override
public void setDisableMissPenalty(boolean value) {
this.combatModule.getOptions().set(CombatModule.DISABLE_MISS_PENALTY, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.common.icon.ItemStackIcon;
import com.lunarclient.apollo.common.icon.SimpleResourceLocationIcon;
import com.lunarclient.apollo.example.common.modules.impl.CooldownExample;
import com.lunarclient.apollo.module.cooldown.Cooldown;
import com.lunarclient.apollo.module.cooldown.CooldownModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import java.time.Duration;
import java.util.Optional;
import org.bukkit.entity.Player;

public class CooldownExample {
public class CooldownApiExample extends CooldownExample {

private final CooldownModule cooldownModule = Apollo.getModuleManager().getModule(CooldownModule.class);

@Override
public void displayCooldownItemExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -53,6 +55,7 @@ public void displayCooldownItemExample(Player viewer) {
});
}

@Override
public void displayCooldownResourceExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -70,6 +73,7 @@ public void displayCooldownResourceExample(Player viewer) {
});
}

@Override
public void removeCooldownExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -79,6 +83,7 @@ public void removeCooldownExample(Player viewer) {
});
}

@Override
public void resetCooldownsExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.cooldownModule::resetCooldowns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.common.ApolloEntity;
import com.lunarclient.apollo.example.common.modules.impl.EntityExample;
import com.lunarclient.apollo.module.entity.EntityModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import java.util.List;
Expand All @@ -34,10 +35,11 @@
import org.bukkit.entity.Player;
import org.bukkit.entity.Sheep;

public class EntityExample {
public class EntityApiExample extends EntityExample {

private final EntityModule entityModule = Apollo.getModuleManager().getModule(EntityModule.class);

@Override
public void overrideRainbowSheepExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -51,6 +53,7 @@ public void overrideRainbowSheepExample(Player viewer) {
});
}

@Override
public void resetRainbowSheepExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -64,6 +67,7 @@ public void resetRainbowSheepExample(Player viewer) {
});
}

@Override
public void flipEntityExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand All @@ -79,6 +83,7 @@ public void flipEntityExample(Player viewer) {
});
}

@Override
public void resetFlippedEntityExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.lunarclient.apollo.example.modules;
package com.lunarclient.apollo.example.api.examples;

import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.example.common.modules.impl.GlowExample;
import com.lunarclient.apollo.module.glow.GlowModule;
import com.lunarclient.apollo.player.ApolloPlayer;
import com.lunarclient.apollo.recipients.Recipients;
Expand All @@ -32,21 +33,24 @@
import java.util.UUID;
import org.bukkit.entity.Player;

public class GlowExample {
public class GlowApiExample extends GlowExample {

private final GlowModule glowModule = Apollo.getModuleManager().getModule(GlowModule.class);

@Override
public void overrideGlowEffectExample(UUID glowingPlayer) {
this.glowModule.overrideGlow(Recipients.ofEveryone(),
glowingPlayer,
Color.RED
);
}

@Override
public void resetGlowEffectExample(UUID glowingPlayer) {
this.glowModule.resetGlow(Recipients.ofEveryone(), glowingPlayer);
}

@Override
public void resetGlowEffectsExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.glowModule::resetGlow);
Expand Down
Loading

1 comment on commit ac5d48a

@LunarClientBot
Copy link
Collaborator

@LunarClientBot LunarClientBot commented on ac5d48a Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📄 Documentation Deployment

Status:✅ Completed
Environment:preview
URL:https://e9ca57c3.lunarclient-dev.pages.dev

Please sign in to comment.