Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightweight: Documentation #172

Open
wants to merge 57 commits into
base: version/1.1.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
aaf02ca
Add a bunch of lightweight examples
ItsNature Sep 3, 2024
dc6b3a6
Add more examples
ItsNature Sep 3, 2024
ef76599
Even more examples...
ItsNature Sep 5, 2024
d330a41
More examples & prepare for example plugin merge
ItsNature Sep 6, 2024
30ee45a
Fix adventure usages
ItsNature Sep 6, 2024
86e9790
Testable state
ItsNature Sep 9, 2024
466f09f
Add more notes
ItsNature Sep 9, 2024
eef70d4
Add switch implementation command
ItsNature Sep 10, 2024
589a117
Finish more examples, start working on markdown
ItsNature Sep 10, 2024
5ae846f
Spotless fixes
ItsNature Sep 10, 2024
d52d064
Update beam.mdx with new examples
ItsNature Sep 10, 2024
30daf89
Finish team examples
ItsNature Sep 10, 2024
c4a8928
More markdown work
ItsNature Sep 12, 2024
ac0c94a
Add missing import to chat.mdx
ItsNature Sep 12, 2024
8f93f64
Move builders outside tabs again
ItsNature Sep 12, 2024
4474747
Fix remaining serialization issues
ItsNature Sep 12, 2024
7d0eeb2
Add more markdown examples
ItsNature Sep 13, 2024
eea210e
Add hologram & limb examples
ItsNature Sep 13, 2024
2dc65ae
move builders inside API tab, add nametag, nickhider & notification e…
ItsNature Sep 13, 2024
75ea8f6
Finish proto examples
ItsNature Sep 16, 2024
7b536dc
Remove object utils
ItsNature Sep 16, 2024
35b2cb0
add temp layout
TrentinTheKid Sep 17, 2024
1a5e495
Finish all Json Examples
ItsNature Sep 17, 2024
2d606d5
Merge branch 'version/1.1.6' into feature/lightweight-example-plugin
ItsNature Sep 17, 2024
32edd44
Add Tebex module locale field to lightweight examples
ItsNature Sep 17, 2024
f100606
The merge!
ItsNature Sep 17, 2024
0ca8856
Start lightweight.mdx rewrite
ItsNature Sep 18, 2024
f750939
Close tab
ItsNature Sep 18, 2024
0323734
Import callout
ItsNature Sep 18, 2024
895be25
ADd modsettings examples
ItsNature Sep 18, 2024
1f35ca3
richpresence, serverrule, staffmod, stopwatch, title, tntcountdown, t…
ItsNature Sep 18, 2024
c957e50
Protobuf Lightweight Documentation
ItsNature Sep 19, 2024
afed09a
Minor changes
ItsNature Sep 19, 2024
7c270ad
Updating player world code & markdown, packet enrichment & minor para…
ItsNature Sep 19, 2024
df9efba
Fix links
ItsNature Sep 19, 2024
b0b1833
Fix the fixed links
ItsNature Sep 19, 2024
c3d0b21
Spotless fixes
ItsNature Sep 19, 2024
5532908
Add lightweight callout to intro
TrentinTheKid Oct 1, 2024
25a6dc2
add intro to meta json
TrentinTheKid Oct 1, 2024
a42f0d3
Finish JSON lightweight docs
ItsNature Oct 1, 2024
17db1a2
Remove old lightweight.mdx
ItsNature Oct 1, 2024
6ab20b8
Link usage methods, add module examples note
ItsNature Oct 1, 2024
43d2209
resolve callout issue?
TrentinTheKid Oct 1, 2024
1248596
Rebuild
ItsNature Oct 3, 2024
ac7c6bc
Team markdown examples
ItsNature Oct 3, 2024
ac7da0e
update callout
TrentinTheKid Oct 5, 2024
4a3303b
update callout
TrentinTheKid Oct 5, 2024
0dfbb33
remove placeholder text
TrentinTheKid Oct 5, 2024
96204a1
Remove build status
TrentinTheKid Oct 5, 2024
fa5d83c
Replace Component#appendNewLine with Component.append(Component.newli…
ItsNature Oct 7, 2024
a37c38b
Default implementation type to API
ItsNature Oct 7, 2024
23c6a8e
Remove protobuf-java-util dependency
ItsNature Oct 7, 2024
bafc665
Final touch-ups
ItsNature Oct 7, 2024
5782f95
fix typo
TrentinTheKid Oct 8, 2024
5d15714
Wording Change
TrentinTheKid Oct 9, 2024
7827770
Lightning -> Lighting
TrentinTheKid Oct 9, 2024
bf6cce2
Use Futures for Roundtrip example & implement timeout
ItsNature Oct 9, 2024
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
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
12 changes: 12 additions & 0 deletions bukkit-example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
plugins {
id("apollo.base-conventions")
id("apollo.shadow-conventions")
}

dependencies {
compileOnly(libs.bukkit.api)

// Used for Proto Implementation
api(libs.protobuf)

// Used for Proto & Json Implementation
api(libs.bundles.adventure) {
exclude("org.checkerframework")
exclude("net.kyori", "adventure-api")
exclude("net.kyori", "adventure-bom")
}

// Used for API Implementation
compileOnly(project(":extra:apollo-extra-adventure4"))
compileOnly(project(path = ":apollo-api", configuration = "bukkit"))
}

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
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
* 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.google.common.collect.Lists;
import com.lunarclient.apollo.Apollo;
import com.lunarclient.apollo.common.location.ApolloLocation;
import com.lunarclient.apollo.example.common.modules.impl.HologramExample;
import com.lunarclient.apollo.module.hologram.Hologram;
import com.lunarclient.apollo.module.hologram.HologramModule;
import com.lunarclient.apollo.player.ApolloPlayer;
Expand All @@ -36,10 +37,11 @@
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.entity.Player;

public class HologramExample {
public class HologramApiExample extends HologramExample {

private final HologramModule hologramModule = Apollo.getModuleManager().getModule(HologramModule.class);

@Override
public void displayHologramExample() {
this.hologramModule.displayHologram(Recipients.ofEveryone(), Hologram.builder()
.id("welcome-hologram")
Expand All @@ -66,10 +68,12 @@ public void displayHologramExample() {
);
}

@Override
public void removeHologramExample() {
this.hologramModule.removeHologram(Recipients.ofEveryone(), "welcome-hologram");
}

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