Skip to content

Commit

Permalink
The merge!
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNature committed Sep 17, 2024
1 parent 32edd44 commit f100606
Show file tree
Hide file tree
Showing 180 changed files with 892 additions and 2,894 deletions.
1 change: 0 additions & 1 deletion .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<suppressions>
<!-- don't require javadocs on platform modules -->
<suppress files="bukkit-example[\\/]src[\\/]main[\\/]java[\\/].*" checks="(FilteringWriteTag|MissingJavadoc.*)"/>
<suppress files="lightweight-bukkit-example[\\/]src[\\/]main[\\/]java[\\/].*" checks="(FilteringWriteTag|MissingJavadoc.*)"/>

<!-- ignore illegal import in loader -->
<suppress files="extra[\\/]loader[\\/]src[\\/]main[\\/]java[\\/].*" checks="(IllegalImport)"/>
Expand Down
14 changes: 14 additions & 0 deletions bukkit-example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
plugins {
id("apollo.base-conventions")
id("apollo.shadow-conventions")
}

dependencies {
compileOnly(libs.bukkit.api)

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

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

// 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,20 +21,22 @@
* 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 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 int countdown = 5;

@Override
public void displayLiveChatMessageExample() {
this.chatModule.displayLiveChatMessage(Recipients.ofEveryone(),
Component.text("Game starting in ", NamedTextColor.GREEN)
Expand All @@ -47,6 +49,7 @@ public void displayLiveChatMessageExample() {
}
}

@Override
public void removeLiveChatMessageExample() {
this.chatModule.removeLiveChatMessage(Recipients.ofEveryone(), 13);
}
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.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

0 comments on commit f100606

Please sign in to comment.