diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml deleted file mode 100644 index 149d2f5..0000000 --- a/.forgejo/workflows/build.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build - -on: - push: - paths: - - 'src/**' - - '.github/**' - - 'build.gradle.kts' - - 'gradle.properties' - - 'settings.gradle' - -jobs: - build: - runs-on: arch-linux - env: - NEMESIS_VERSION_NAME: "autobuild-${{ github.sha }}" - NEMESIS_BUILD_CHANNEL: "autobuild" - steps: - - name: Checkout - uses: actions/checkout@v6.0.1 - - - name: Setup Java enviroment - uses: actions/setup-java@v5.1.0 - with: - distribution: temurin - java-version: 21 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 - - - name: Download CB1060 - run: | - mkdir -p libs - curl -L -o libs/craftbukkit-1060.jar https://archive.org/download/craftbukkit1060/craftbukkit1-7-3%281060%29.jar - - - name: Build with Gradle - run: ./gradlew buildAll - - - - name: Upload artifacts - uses: actions/upload-artifact@v6.0.0 - with: - path: build/libs/*.jar diff --git a/.forgejo/workflows/release-build.yml b/.forgejo/workflows/release-build.yml deleted file mode 100644 index 392e32e..0000000 --- a/.forgejo/workflows/release-build.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Release Build - -on: - release: - types: [published] - -jobs: - build-and-release: - runs-on: arch-linux - env: - NEMESIS_VERSION_NAME: "${{ github.ref_name }}" - NEMESIS_BUILD_CHANNEL: "production" - steps: - - name: Checkout - uses: actions/checkout@v6.0.1 - - - name: Set up Java - uses: actions/setup-java@v5.1.0 - with: - distribution: temurin - java-version: 21 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v5 - - - name: Download CB1060 - run: | - mkdir -p libs - curl -L -o libs/craftbukkit-1060.jar \ - https://archive.org/download/craftbukkit1060/craftbukkit1-7-3%281060%29.jar - - - name: Build with Gradle - run: ./gradlew buildAll - - - name: Upload JARs to release - uses: softprops/action-gh-release@v2.5.0 - with: - files: build/libs/*.jar - tag_name: ${{ github.ref_name }} - name: ${{ github.ref_name }} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ac1941e..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -github: adrianvic -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username -thanks_dev: # Replace with a single thanks.dev username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0e8199d..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build - -on: - workflow_dispatch: - push: - paths: - - 'src/**' - - '.github/**' - - 'build.gradle.kts' - - 'gradle.properties' - - 'settings.gradle' - -jobs: - build: - runs-on: ubuntu-latest - env: - NEMESIS_VERSION_NAME: "autobuild-${{ github.sha }}" - NEMESIS_BUILD_CHANNEL: "autobuild" - steps: - - name: Checkout - uses: actions/checkout@v6.0.1 - - - name: Setup Java enviroment - uses: actions/setup-java@v5.1.0 - with: - distribution: temurin - java-version: 21 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 - - - name: Download CB1060 - run: | - mkdir -p libs - curl -L -o libs/craftbukkit-1060.jar https://archive.org/download/craftbukkit1060/craftbukkit1-7-3%281060%29.jar - - - name: Build with Gradle - run: ./gradlew buildAll - - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - path: build/libs/*.jar diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml deleted file mode 100644 index 9570712..0000000 --- a/.github/workflows/release-build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Release Build - -on: - release: - types: [published] - -jobs: - build-and-release: - runs-on: ubuntu-latest - env: - NEMESIS_VERSION_NAME: "${{ github.ref_name }}" - NEMESIS_BUILD_CHANNEL: "production" - steps: - - name: Checkout - uses: actions/checkout@v6.0.1 - - - name: Set up Java - uses: actions/setup-java@v5.1.0 - with: - distribution: temurin - java-version: 21 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@v5 - - - name: Download CB1060 - run: | - mkdir -p libs - curl -L -o libs/craftbukkit-1060.jar \ - https://archive.org/download/craftbukkit1060/craftbukkit1-7-3%281060%29.jar - - - name: Build with Gradle - run: ./gradlew buildAll - - - name: Upload artifacts to release - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ - -H "Content-Type: application/octet-stream" \ - https://inspiran.beetal-castor.ts.net/git/api/v1/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}/assets \ - --data-binary @build/libs/your-artifact.jar \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1e3abdf..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.gradle/ -build/ -out/ -.idea/ -libs/ -run/ diff --git a/.gradle/8.8/checksums/checksums.lock b/.gradle/8.8/checksums/checksums.lock new file mode 100644 index 0000000..1fc7f10 Binary files /dev/null and b/.gradle/8.8/checksums/checksums.lock differ diff --git a/.gradle/8.8/checksums/md5-checksums.bin b/.gradle/8.8/checksums/md5-checksums.bin new file mode 100644 index 0000000..f239517 Binary files /dev/null and b/.gradle/8.8/checksums/md5-checksums.bin differ diff --git a/.gradle/8.8/checksums/sha1-checksums.bin b/.gradle/8.8/checksums/sha1-checksums.bin new file mode 100644 index 0000000..e2db85d Binary files /dev/null and b/.gradle/8.8/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.8/dependencies-accessors/gc.properties b/.gradle/8.8/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/8.8/executionHistory/executionHistory.bin b/.gradle/8.8/executionHistory/executionHistory.bin new file mode 100644 index 0000000..99e1191 Binary files /dev/null and b/.gradle/8.8/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.8/executionHistory/executionHistory.lock b/.gradle/8.8/executionHistory/executionHistory.lock new file mode 100644 index 0000000..f69dcd5 Binary files /dev/null and b/.gradle/8.8/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.8/fileChanges/last-build.bin b/.gradle/8.8/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.8/fileChanges/last-build.bin differ diff --git a/.gradle/8.8/fileHashes/fileHashes.bin b/.gradle/8.8/fileHashes/fileHashes.bin new file mode 100644 index 0000000..d26d2d2 Binary files /dev/null and b/.gradle/8.8/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.8/fileHashes/fileHashes.lock b/.gradle/8.8/fileHashes/fileHashes.lock new file mode 100644 index 0000000..4eb757c Binary files /dev/null and b/.gradle/8.8/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.8/fileHashes/resourceHashesCache.bin b/.gradle/8.8/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..772a426 Binary files /dev/null and b/.gradle/8.8/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.8/gc.properties b/.gradle/8.8/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..d49b8d6 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..44a92ec --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Mon Dec 01 17:53:37 BRT 2025 +gradle.version=8.8 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..83af394 Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..0a94ba4 Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..74169cd --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +regions \ No newline at end of file diff --git a/.idea/artifacts/regions_jar.xml b/.idea/artifacts/regions_jar.xml new file mode 100644 index 0000000..321e226 --- /dev/null +++ b/.idea/artifacts/regions_jar.xml @@ -0,0 +1,9 @@ + + + $PROJECT_DIR$/../../testing/mcregions/plugins/ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..f2c1963 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..17d4326 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/mcregions.iml b/.idea/mcregions.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/mcregions.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5cd9a10 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules/regions.main.iml b/.idea/modules/regions.main.iml new file mode 100644 index 0000000..bbeeb3e --- /dev/null +++ b/.idea/modules/regions.main.iml @@ -0,0 +1,14 @@ + + + + + + + PAPER + ADVENTURE + + 1 + + + + \ 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/README.md b/README.md index bf357cf..c4aceff 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,4 @@ -eye_of_nemesis_social_cover - -[![Modrinth Badge](https://img.shields.io/badge/Modrinth-Black?style=social&logo=Modrinth&logoColor=green)](https://modrinth.com/plugin/eye-of-nemesis) -[![English Wiki Badge](https://img.shields.io/badge/English-White?style=flat-square&label=Wiki&color=black)](https://github.com/adrianvic/NemesisEye/wiki) -[![Portuguese Wiki Badge](https://img.shields.io/badge/Portuguese-White?style=flat-square&label=Wiki&color=black)](https://mgr.rf.gd/w/Eye_of_Nemesis) - -> [!IMPORTANT] -> This project is in an early stage, please report any bug you find. - # Eye of Nemesis -Eye of Nemesis is a plugin that allows server admins to write policies that will deny or allow (black/whitelist) players to do specific things based on the value of nodes. +Eye of Nemesis is a Minecraft Paper plugin that allows server admins to write *policies* that will deny or allow (black/whitelist) players to do specific things. -## Motivations -I made this plugin as an effort to preserve a village from my private server. Originally from beta 1.7.3 Betalands server, then transferred to RetroMC, and then finally we downloaded the chunks to merge into our server, I was afraid it would not have the same feeling after all the updates, so I had the idea to make a plugin that can block the newer features. - -## Game version and loaders -Since version 1.0.3-SNAPSHOT, Eye of Nemesis has _reflection_, a technique that allows me to target multiple versions of the game while sharing the codebase across versions. - -Currently, we support the following Minecraft versions/loaders: -- **PaperMC** `1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10` -- **Bukkit** `b1.7.3 (CB1060)` - -## Performance -This plugin is not scalable as it is and will end up running unoptimized checks when your players do things with policies in effect, I made it for a server with a few friends. I'll look forward into writing more performant code after all my other priorities are implemented. +You can create policies based on player location, ~but other types of policies are available, like permission and player-name policy.~ (WIP) diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..36427d7 --- /dev/null +++ b/build.gradle @@ -0,0 +1,55 @@ +plugins { + id 'java' + id("xyz.jpenilla.run-paper") version "2.3.1" +} + +group = 'io.github.adrianvic' +version = '1.0-SNAPSHOT' + +repositories { + mavenCentral() + maven { + name = "papermc-repo" + url = "https://repo.papermc.io/repository/maven-public/" + } +} + +dependencies { + compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT") +} + +tasks { + runServer { + // Configure the Minecraft version for our task. + // This is the only required configuration besides applying the plugin. + // Your plugin's jar (or shadowJar if present) will be used automatically. + minecraftVersion("1.21") + } +} + +def targetJavaVersion = 21 +java { + def javaVersion = JavaVersion.toVersion(targetJavaVersion) + sourceCompatibility = javaVersion + targetCompatibility = javaVersion + if (JavaVersion.current() < javaVersion) { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + } +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' + + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { + options.release.set(targetJavaVersion) + } +} + +processResources { + def props = [version: version] + inputs.properties props + filteringCharset 'UTF-8' + filesMatching('plugin.yml') { + expand props + } +} diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index e2d9a2e..0000000 --- a/build.gradle.kts +++ /dev/null @@ -1,154 +0,0 @@ -plugins { - java - id("xyz.jpenilla.run-paper") version "2.3.1" -} - -group = "io.github.adrianvic" -version = System.getenv("NEMESIS_VERSION_NAME") ?: "unknown" - -repositories { - mavenCentral() - maven("https://repo.papermc.io/repository/maven-public/") -} - -/* ----------------------------------------- */ -/* SUPPORTED VERSIONS */ -/* ----------------------------------------- */ - -val mcVersions = listOf( - "b1_7_3", - "r1_21" -) - -/* ----------------------------------------- */ -/* CREATE SOURCE SET PER VERSION */ -/* ----------------------------------------- */ - -tasks.withType { - inputs.property("version", project.version) - - filesMatching("plugin.yml") { - expand("version" to project.version) - } -} - -mcVersions.forEach { ver -> - val ss = sourceSets.create(ver) { - java.srcDir("src/$ver/java") - - resources.setSrcDirs(listOf("src/$ver/resources", "src/main/resources")) - - compileClasspath += sourceSets["main"].output - runtimeClasspath += output + compileClasspath - } - - tasks.withType { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - } - - configurations[ss.implementationConfigurationName] - .extendsFrom(configurations["implementation"]) - - configurations[ss.compileOnlyConfigurationName] - .extendsFrom(configurations["compileOnly"]) - -} - -/* ----------------------------------------- */ -/* DEPENDENCIES */ -/* ----------------------------------------- */ - -dependencies { - add("compileOnly", "io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") - add("r1_21CompileOnly", "io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") - add("b1_7_3CompileOnly", files("libs/craftbukkit-1060.jar")) - - testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") - testImplementation("org.mockito:mockito-core:5.5.0") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") - testImplementation("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT") - testImplementation("com.github.seeseemelk:MockBukkit-v1.21:3.102.0") - - // Allow tests to see the versioned implementations - mcVersions.forEach { ver -> - testImplementation(sourceSets[ver].output) - } -} - -tasks.test { - useJUnitPlatform() -} - -/* ----------------------------------------- */ -/* BUILD TASKS */ -/* ----------------------------------------- */ - -mcVersions.forEach { ver -> - tasks.register("jar${ver.replace(".", "_").replace("-", "_").replace("/", "_").capitalize()}") { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - from(sourceSets["main"].output) - from(sourceSets[ver].output) - archiveClassifier.set(ver) - - manifest { - attributes( - "Nemesis-Impl-Version" to ver, - "Nemesis-Environment" to (System.getenv("NEMESIS_BUILD_CHANNEL") ?: "dev") - ) - } - - } -} - -tasks.register("buildAll") { - dependsOn(tasks.withType()) -} - -tasks.register("shadowJar") { - from(sourceSets["main"].output) - mcVersions.forEach { ver -> - from(sourceSets[ver].output) - } - - // This is kinda gross and, essentially, we shouldn't have it here... - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - - archiveClassifier.set("all-implementations") - archiveVersion.set(project.version.toString()) - - manifest { - attributes( - "Implemented-Versions" to mcVersions.joinToString(",") - ) - } -} - -/* ----------------------------------------- */ -/* JAVA SETTINGS */ -/* ----------------------------------------- */ - -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(21)) -} - -tasks.withType { - options.encoding = "UTF-8" -} - -tasks.runServer { - minecraftVersion("1.21") - downloadPlugins { - modrinth("viaversion", "5.7.0") - modrinth("luckperms", "v5.5.17-bukkit") - } -} - -tasks.register("runServerClean") { - doFirst { - exec { - commandLine("rm", "run/plugins/Eye-of-Nemesis/settings.yml") - } - } - - dependsOn("runServer") -} \ No newline at end of file diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/Config.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/Config.class new file mode 100644 index 0000000..fc9103e Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/Config.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/DataShifter.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/DataShifter.class new file mode 100644 index 0000000..7dd4a1f Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/DataShifter.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/EventListener.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/EventListener.class new file mode 100644 index 0000000..7beeaf7 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/EventListener.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/Nemesis.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/Nemesis.class new file mode 100644 index 0000000..cced384 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/Nemesis.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/Validator.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/Validator.class new file mode 100644 index 0000000..12cf9e4 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/Validator.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/Eye.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/Eye.class new file mode 100644 index 0000000..418ee9c Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/Eye.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/CurrentPolicies.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/CurrentPolicies.class new file mode 100644 index 0000000..02f78ce Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/CurrentPolicies.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/ListPolicies.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/ListPolicies.class new file mode 100644 index 0000000..c3f131a Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/ListPolicies.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/PolicyInfo.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/PolicyInfo.class new file mode 100644 index 0000000..7b25602 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/PolicyInfo.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Reload.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Reload.class new file mode 100644 index 0000000..38f2627 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Reload.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Subcommand.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Subcommand.class new file mode 100644 index 0000000..6f93a73 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/commands/sub/Subcommand.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/Action.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/Action.class new file mode 100644 index 0000000..6f1c0fe Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/Action.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/LocationPolicy.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/LocationPolicy.class new file mode 100644 index 0000000..a15c3c8 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/LocationPolicy.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandler.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandler.class new file mode 100644 index 0000000..35ed765 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandler.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandlers.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandlers.class new file mode 100644 index 0000000..1f38b52 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeHandlers.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeValueParser.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeValueParser.class new file mode 100644 index 0000000..86cedeb Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/NodeValueParser.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PermissionPolicy.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PermissionPolicy.class new file mode 100644 index 0000000..3005c0b Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PermissionPolicy.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PlayerNamePolicy.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PlayerNamePolicy.class new file mode 100644 index 0000000..244062f Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PlayerNamePolicy.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PolicyNode.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PolicyNode.class new file mode 100644 index 0000000..6645152 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/PolicyNode.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/attackWith.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/attackWith.class new file mode 100644 index 0000000..8f29cb3 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/attackWith.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useEnchantment.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useEnchantment.class new file mode 100644 index 0000000..03581d3 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useEnchantment.class differ diff --git a/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useItem.class b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useItem.class new file mode 100644 index 0000000..af645a1 Binary files /dev/null and b/build/classes/java/main/io/github/adrianvic/nemesiseye/policy/handlers/useItem.class differ diff --git a/build/resources/main/plugin.yml b/build/resources/main/plugin.yml new file mode 100644 index 0000000..612eeed --- /dev/null +++ b/build/resources/main/plugin.yml @@ -0,0 +1,4 @@ +name: regions +version: '1.0-SNAPSHOT' +main: io.github.adrianvic.regions.Regions +api-version: '1.21' diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/PlaceListener.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/PlaceListener.class.uniqueId1 new file mode 100644 index 0000000..816f2df Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/PlaceListener.class.uniqueId1 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/Regions.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/Regions.class.uniqueId0 new file mode 100644 index 0000000..fe7a516 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/Regions.class.uniqueId0 differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..10eecb4 Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/docs/Nodes.md b/docs/Nodes.md deleted file mode 100644 index 57cff1d..0000000 --- a/docs/Nodes.md +++ /dev/null @@ -1,34 +0,0 @@ -# Nodes -Nodes narrow down even further if an action can be done or not. A node needs _properties_ to know what it should check against, for example, a HIT node needs a _list_ of blocks that it will check if the player is holding; while a USE_ENCHANTMENT node needs a mapping of enchantment to level. Some nodes like glyde don't need a value and will ignore if you provide one. -```yaml -nodes: - - [HIT]: - values: - - 'GOLD_SWORD' - - [USE_ENCHANTMENT]: - values: - - "UNBREAKING": "1" - - [GLYDE] -``` - -## Available nodes -### INTERACT -Triggered on `InteractionEvent`, returns true when the provided `list` contains the material used to interact. - -### HIT -Triggered on `EntityDamageByEntityEvent`, returns true when the provided `list` contains the material used to hit. - -### PLACE -Triggered on `BlockPlaceEvent`, returns true when the provided `list` contains the material being placed. - -### BREAK -Triggered on `BlockBreakEvent`, returns true when the provided `list` contains the material used to break. - -### EQUIP -Triggered on `InventoryClickEvent` and `PlayerInteractEvent` (only if item is an armor), returns true when the provided `list` contains the material being equipped. - -### GLYDE -Triggered on `PlayerMoveEvent`, returns true if player is gliding. - -### USE_ENCHANTMENT -Triggered on `BlockBreakEvent` and `onEntityDamageByEntityEvent`, returns true the used item has an enchantment matching the provided mapping of enchantment-level. \ No newline at end of file diff --git a/docs/Policies.md b/docs/Policies.md deleted file mode 100644 index 21d468d..0000000 --- a/docs/Policies.md +++ /dev/null @@ -1,89 +0,0 @@ -# Policies -Policies are a list of nodes with a specific condition to be met, they also determine what effect a node is going to have. Below is an example policy: -```yaml - - name: "Allow example" - type: "location" - effect: ALLOW - weight: 1 - worlds: [world] - locations: - coordinates: - - corner1: { x: 2100, y: 256, z: 1400 } - corner2: { x: 1000, y: -64, z: 2200 } - nodes: - - [INTERACT, BREAK, HIT, PLACE]: - values: - - AIR -``` - -## Properties -### `name` -Name of the policy, must not contain spaces or else commands that require you to type the policy name will not work. - -Example: `name: "disable-axe-damage"` - -### `type` -One of the policy [types](#Types). - -Example: `type: location` - -### `effect` -Can be `deny` to block the action if a node check returns true, `ALLOW` to revert `DENY` effects if the node check is true or `ALLOWONLY` to allow the action **only** if the node check returns true. - -Example: `effect: DENY` - -### `weight` -A policy with greater weight will override a conflicting policy of lower weight. - -Example: `weight: 0` - -### `nodes` -Must contain a list of node mappings to evaluate if the policy applies to a player. - -Example: -```yaml -nodes: - - [HIT]: - values: - - '.*_AXE$' -``` - -### `locations` -Only used for `type: "location"`, is a list of mappings where corner1 and corner2 should map x, y and z to two corners of a rectangular area where the policy will take effect; `worlds` may be defined here. - -Example: - -```yaml -locations: - worlds: [world] - coordinates: - - corner1: { x: 2100, y: 256, z: 1400 } - corner2: { x: 1000, y: -64, z: 2200 } -``` - -### `permissions` -Only used for `type: "permission"`, is a list of permissions. - -Example: - -```yaml -permissions: - - "server.axehit" -``` - -### `names` -Only used for `type: "playerName"`, is a list of player names. - -## Types - -### `global` -Always matches. - -### `location` -Matches if the player location is inside any rectangle defined in the `locations` property. - -### `playerName` -Matches if the player name is in the `names` property. - -### `permission` -Matches if the player has a permission in the `permissions` property. diff --git a/out/production/resources/plugin.yml b/out/production/resources/plugin.yml new file mode 100644 index 0000000..8b85727 --- /dev/null +++ b/out/production/resources/plugin.yml @@ -0,0 +1,10 @@ +name: "Eye-of-Nemesis" +version: '1.0-SNAPSHOT' +main: io.github.adrianvic.nemesiseye.Nemesis +api-version: '1.21' +author: 'Adrian Victor' +website: "https://github.io/adrianvic/NemesisEye" +description: "Change what players can do based in custom criteria." +commands: + eye: + usage: "/eye