commit b2a18547f6d5b37dfacdc9581d1fa53b7306536d Author: Big Pappa Date: Sat Sep 12 22:37:18 2026 -0500 0.1.0 Original diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..cd68902 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..828a0d8 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d61b968 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8e39a24 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/RS-Compass.iml b/RS-Compass.iml new file mode 100644 index 0000000..3cf00db --- /dev/null +++ b/RS-Compass.iml @@ -0,0 +1,13 @@ + + + + + + + PAPER + + 1 + + + + \ No newline at end of file diff --git a/docs/0 b/docs/0 new file mode 100644 index 0000000..e69de29 diff --git a/docs/images/Compass.jpg b/docs/images/Compass.jpg new file mode 100644 index 0000000..1273776 Binary files /dev/null and b/docs/images/Compass.jpg differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3845537 --- /dev/null +++ b/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + + com.rsscripting + RS-Compass + 0.1.0 + jar + + RS-Compass + + + 21 + UTF-8 + + + + ${project.artifactId}-${project.version} + clean package + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.3 + + + package + + shade + + + + + + + + src/main/resources + true + + + + + + + papermc-repo + https://repo.papermc.io/repository/maven-public/ + + + + + + io.papermc.paper + paper-api + 1.21.11-R0.1-SNAPSHOT + provided + + + diff --git a/src/main/java/com/rsscripting/rscompass/RSCompass.java b/src/main/java/com/rsscripting/rscompass/RSCompass.java new file mode 100644 index 0000000..c6617c7 --- /dev/null +++ b/src/main/java/com/rsscripting/rscompass/RSCompass.java @@ -0,0 +1,82 @@ +package com.rsscripting.rscompass; + +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; + +public final class RSCompass extends JavaPlugin { + + private BukkitTask compassTask; + + private static final String[] DIRECTIONS = { + "S", "SW", "W", "NW", "N", "NE", "E", "SE" + }; + + @Override + public void onEnable() { + getLogger().info("RS-Compass enabled!"); + + startCompassTask(); + } + + @Override + public void onDisable() { + if (compassTask != null) { + compassTask.cancel(); + } + + getLogger().info("RS-Compass disabled!"); + } + + private void startCompassTask() { + compassTask = getServer().getScheduler().runTaskTimer( + this, + () -> { + for (Player player : getServer().getOnlinePlayers()) { + displayCompass(player); + } + }, + 0L, + 1L + ); + } + + private void displayCompass(Player player) { + int directionIndex = getDirectionIndex(player); + + Component compass = Component.empty(); + + for (int i = -2; i <= 2; i++) { + int index = Math.floorMod(directionIndex + i, DIRECTIONS.length); + + String direction = DIRECTIONS[index]; + + Component directionComponent = Component.text(direction); + + if (i == 0) { + directionComponent = directionComponent + .color(NamedTextColor.AQUA) + .decorate(net.kyori.adventure.text.format.TextDecoration.BOLD); + } else { + directionComponent = directionComponent + .color(NamedTextColor.WHITE); + } + + compass = compass.append( + Component.text(" ") + ).append(directionComponent); + } + + player.sendActionBar(compass); + } + + private int getDirectionIndex(Player player) { + float yaw = player.getLocation().getYaw(); + + yaw = (yaw % 360 + 360) % 360; + + return Math.round(yaw / 45) % 8; + } +} \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..98496e2 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,6 @@ +name: RS-Compass +version: ${project.version} +main: com.rsscripting.rscompass.RSCompass +api-version: '1.21' +author: RSScripting +description: A lightweight HUD compass and coordinate navigation plugin. \ No newline at end of file diff --git a/target/RS-Compass-0.1.0-shaded.jar b/target/RS-Compass-0.1.0-shaded.jar new file mode 100644 index 0000000..a10b8bd Binary files /dev/null and b/target/RS-Compass-0.1.0-shaded.jar differ diff --git a/target/RS-Compass-0.1.0.jar b/target/RS-Compass-0.1.0.jar new file mode 100644 index 0000000..a10b8bd Binary files /dev/null and b/target/RS-Compass-0.1.0.jar differ diff --git a/target/classes/com/rsscripting/rscompass/RSCompass.class b/target/classes/com/rsscripting/rscompass/RSCompass.class new file mode 100644 index 0000000..f6c61c7 Binary files /dev/null and b/target/classes/com/rsscripting/rscompass/RSCompass.class differ diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml new file mode 100644 index 0000000..c640678 --- /dev/null +++ b/target/classes/plugin.yml @@ -0,0 +1,6 @@ +name: RS-Compass +version: 0.1.0 +main: com.rsscripting.rscompass.RSCompass +api-version: '1.21' +author: RSScripting +description: A lightweight HUD compass and coordinate navigation plugin. \ No newline at end of file diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..b0f5af2 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=RS-Compass +groupId=com.rsscripting +version=0.1.0 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..541fca8 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com\rsscripting\rscompass\RSCompass.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..75ada36 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +C:\Users\russe\IdeaProjects\RS-Compass\src\main\java\com\rsscripting\rscompass\RSCompass.java diff --git a/target/original-RS-Compass-0.1.0.jar b/target/original-RS-Compass-0.1.0.jar new file mode 100644 index 0000000..6cf862b Binary files /dev/null and b/target/original-RS-Compass-0.1.0.jar differ