mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-11-26 15:54:25 +00:00
Online editor + auto deployment/releases (#264)
* web editor * editor command help * editor sync cmd * removed same user restriction * removed player executed restriction * no server identifier sent to server * editor url updated * config harsher verification + send world names to editor api * no more session controls * addons editor commands * moved rtp to /betterrtp-core to create a better env for maven compiling * bettersync lib * Own core and addon editor schemas with BetterSync validation * Simplify editor metadata and publish core and addon schemas on release * Release core and addons together using their Maven versions * Exclude unavailable ProtocolLib executor snapshot from Addons build * betterrtp compiling
This commit is contained in:
1 parent
4697f06163
commit
c8c5a04a59
224 files changed
+2041
-388
No files matched your search
@@ -0,0 +1,37 @@
|
||||
name: Publish editor schema
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
publish:
|
||||
if: '!github.event.release.prerelease'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name }}
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
- name: Prepare plugin-owned schemas
|
||||
env:
|
||||
SCHEMA_PATHS: BetterRTP-Core/src/main/resources/META-INF/editor-schema.json BetterRTPAddons/src/main/resources/META-INF/editor-schema.json
|
||||
run: |
|
||||
node --input-type=module <<'JS'
|
||||
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
||||
mkdirSync('editor-schemas');
|
||||
for (const path of process.env.SCHEMA_PATHS.split(' ')) {
|
||||
const bytes = readFileSync(path), meta = JSON.parse(bytes)['x-bettersync'];
|
||||
if (meta?.format !== 1 || !/^[a-z0-9-]+$/.test(meta.plugin) || !/^[A-Za-z0-9._-]+$/.test(meta.schemaVersion)) throw new Error('Invalid schema identity');
|
||||
writeFileSync(`editor-schemas/${meta.plugin}-${meta.schemaVersion}.schema.json`, bytes);
|
||||
}
|
||||
JS
|
||||
- name: Attach schemas to this plugin release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||
run: gh release upload "$RELEASE_TAG" editor-schemas/*.schema.json
|
||||
@@ -0,0 +1,79 @@
|
||||
name: Release BetterRTP Maven version
|
||||
on:
|
||||
push:
|
||||
branches: [online-editor]
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: write
|
||||
concurrency:
|
||||
group: release-maven-version
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
release:
|
||||
if: github.ref == 'refs/heads/online-editor'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
cache: maven
|
||||
- name: Read BetterRTP Maven version
|
||||
id: version
|
||||
shell: bash
|
||||
run: |
|
||||
mvn -B -q -f BetterRTP-Core/pom.xml help:evaluate -Dexpression=project.version -Doutput="$RUNNER_TEMP/version-0"
|
||||
version0=$(cat "$RUNNER_TEMP/version-0")
|
||||
[[ "$version0" =~ ^[0-9][A-Za-z0-9._-]*$ ]] || { echo "Invalid Maven version"; exit 1; }
|
||||
[[ "$version0" != *SNAPSHOT* ]] || { echo "Snapshot versions are not released"; exit 1; }
|
||||
echo "version0=$version0" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=v$version0" >> "$GITHUB_OUTPUT"
|
||||
echo "title=BetterRTP $version0" >> "$GITHUB_OUTPUT"
|
||||
- name: Check for an existing release
|
||||
id: existing
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
RELEASE_TAG: ${{ steps.version.outputs.tag }}
|
||||
run: |
|
||||
# Listing errors fail the workflow; they are not mistaken for an absent release.
|
||||
releases=$(gh api --paginate "repos/$GH_REPO/releases?per_page=100" --jq '.[].tag_name')
|
||||
if printf '%s\n' "$releases" | grep -Fxq "$RELEASE_TAG"; then
|
||||
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Release $RELEASE_TAG already exists; bump the Maven version for another release."
|
||||
fi
|
||||
- name: Build and test
|
||||
if: steps.existing.outputs.exists != 'true'
|
||||
run: |
|
||||
mvn -B -pl :BetterRTP clean verify
|
||||
mvn -B -f tests/editor/pom.xml verify
|
||||
- name: Prepare BetterRTP JAR and editor schemas
|
||||
if: steps.existing.outputs.exists != 'true'
|
||||
env:
|
||||
# The website still needs Addons field metadata; this does not build its JAR.
|
||||
SCHEMA_PATHS: BetterRTP-Core/src/main/resources/META-INF/editor-schema.json BetterRTPAddons/src/main/resources/META-INF/editor-schema.json
|
||||
run: |
|
||||
mkdir release-assets
|
||||
cp "dist/BetterRTP-${{ steps.version.outputs.version0 }}.jar" release-assets/
|
||||
python3 - <<'PYTHON'
|
||||
import json, os, pathlib, re
|
||||
for path in os.environ['SCHEMA_PATHS'].split():
|
||||
data = pathlib.Path(path).read_bytes()
|
||||
meta = json.loads(data)['x-bettersync']
|
||||
if meta['format'] != 1 or not re.fullmatch(r'[a-z0-9-]+', meta['plugin']) or not re.fullmatch(r'[A-Za-z0-9._-]+', meta['schemaVersion']):
|
||||
raise ValueError('Invalid schema identity')
|
||||
pathlib.Path('release-assets', f"{meta['plugin']}-{meta['schemaVersion']}.schema.json").write_bytes(data)
|
||||
PYTHON
|
||||
- name: Publish versioned release
|
||||
if: steps.existing.outputs.exists != 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
RELEASE_TAG: ${{ steps.version.outputs.tag }}
|
||||
RELEASE_TITLE: ${{ steps.version.outputs.title }}
|
||||
run: |
|
||||
gh release create "$RELEASE_TAG" release-assets/* \
|
||||
--target "$GITHUB_SHA" --title "$RELEASE_TITLE" --generate-notes --latest
|
||||
@@ -18,4 +18,4 @@ jobs:
|
||||
run: cp settings.xml $HOME/.m2/settings.xml
|
||||
|
||||
- name: Build and test with Maven
|
||||
run: mvn test
|
||||
run: mvn -B -pl :BetterRTP test
|
||||
@@ -10,3 +10,5 @@ BetterRTP.wiki/
|
||||
.DS_Store
|
||||
.vscode/
|
||||
node_modules/
|
||||
|
||||
/dist/
|
||||
@@ -0,0 +1,431 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.6.13</version>
|
||||
|
||||
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
||||
|
||||
<properties>
|
||||
<bettersync.version>2.0.0</bettersync.version>
|
||||
<maven.compiler.release>8</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<editor.website>https://www.minecentral.net</editor.website>
|
||||
<editor.buildSuffix></editor.buildSuffix>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!-- Local Server Building -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/../../../Java/plugins</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<finalName>${project.artifactId}-${project.version}${editor.buildSuffix}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/../dist</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!-- Shade PaperLib into project -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<configuration>
|
||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
|
||||
</dependencyReducedPomLocation>
|
||||
<relocations>
|
||||
<relocation><pattern>com.ronanplugins.bettersync</pattern><shadedPattern>me.SuperRonanCraft.BetterRTP.lib.bettersync</shadedPattern></relocation>
|
||||
|
||||
<relocation>
|
||||
<pattern>io.papermc.lib</pattern>
|
||||
<shadedPattern>me.SuperRonanCraft.BetterRTP.lib.paperlib</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.tcoded.folialib</pattern>
|
||||
<shadedPattern>me.SuperRonanCraft.BetterRTP.lib.folialib</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!-- Remove only Shade's unbundled backup, after the final JAR is ready. -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>${project.basedir}/../dist</directory>
|
||||
<includes>
|
||||
<include>${project.artifactId}-*.jar</include>
|
||||
<include>original-${project.artifactId}-*.jar</include>
|
||||
</includes>
|
||||
<followSymlinks>false</followSymlinks>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>remove-unshaded-backup</id>
|
||||
<phase>package</phase>
|
||||
<goals><goal>clean</goal></goals>
|
||||
<configuration>
|
||||
<excludeDefaultDirectories>true</excludeDefaultDirectories>
|
||||
<filesets combine.self="override">
|
||||
<fileset>
|
||||
<directory>${project.basedir}/../dist</directory>
|
||||
<includes><include>original-${project.build.finalName}.jar</include></includes>
|
||||
<followSymlinks>false</followSymlinks>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<!-- CAN BE UNCOMMENTED IF YOU HAVE ACCESS TO THE REPO -->
|
||||
<!--<repository>
|
||||
<id>ronanplugins-private</id>
|
||||
<name>RonanPlugins Repository</name>
|
||||
<url>https://repo.ronanplugins.com/private</url>
|
||||
</repository>-->
|
||||
<!-- GitHub based Repos -->
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<!-- FoliaLib Repo -->
|
||||
<repository>
|
||||
<id>tcoded-releases</id>
|
||||
<url>https://repo.tcoded.com/releases</url>
|
||||
</repository>
|
||||
<!-- Spigot Repo -->
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<!-- PaperMC Repo -->
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<!-- Vault Repo -->
|
||||
<repository>
|
||||
<id>vault-repo</id>
|
||||
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
</repository>
|
||||
<!-- WorldGuard Repo -->
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
<!-- ProjectRed Repo -->
|
||||
<repository>
|
||||
<id>redprotect-repo</id>
|
||||
<url>https://raw.githubusercontent.com/FabioZumbi12/RedProtect/mvn-repo/</url>
|
||||
</repository>
|
||||
<!-- FactionsUUID Repo -->
|
||||
<repository>
|
||||
<id>factions-uuid</id>
|
||||
<url>https://ci.ender.zone/plugin/repository/everything/</url>
|
||||
</repository>
|
||||
<!-- ProtocolLib Repo -->
|
||||
<repository>
|
||||
<id>dmulloy2-repo</id>
|
||||
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||
</repository>
|
||||
<!-- EssentialsX Repo -->
|
||||
<repository>
|
||||
<id>essentials-releases</id>
|
||||
<url>https://repo.essentialsx.net/releases/</url>
|
||||
</repository>
|
||||
<!-- PlaceholderAPI Repo -->
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<!-- MinePlots Repo -->
|
||||
<repository>
|
||||
<id>minecodes-repository-releases</id>
|
||||
<name>mineCodes Organization Repository</name>
|
||||
<url>https://repository.minecodes.pl/releases</url>
|
||||
</repository>
|
||||
<!-- Used by Husk plugins -->
|
||||
<repository>
|
||||
<id>william278-releases</id>
|
||||
<url>https://repo.william278.net/releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<!-- Download the tagged GitHub library through JitPack; bundled by Shade. -->
|
||||
<dependency>
|
||||
<groupId>com.github.RonanPlugins</groupId>
|
||||
<artifactId>BetterSync</artifactId>
|
||||
<version>${bettersync.version}</version>
|
||||
</dependency>
|
||||
<!--Spigot API-->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Spigot Stuff -->
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Paper Library for Async Chunk/Teleport -->
|
||||
<dependency>
|
||||
<groupId>io.papermc</groupId>
|
||||
<artifactId>paperlib</artifactId>
|
||||
<version>1.0.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- WorldGuard (https://dev.bukkit.org/projects/worldguard) -->
|
||||
<dependency> <!-- Saber Factions screws up if updated -->
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
<version>7.0.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- RedProtect (https://www.spigotmc.org/resources/redprotect.15841/) -->
|
||||
<dependency>
|
||||
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
||||
<artifactId>RedProtect-Core</artifactId>
|
||||
<version>7.7.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>br.net.fabiozumbi12.RedProtect</groupId>
|
||||
<artifactId>RedProtect-Spigot-1.13</artifactId>
|
||||
<version>7.7.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- FactionsUUID (https://www.spigotmc.org/resources/factionsuuid.1035/) -->
|
||||
<dependency>
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-U0.6.8</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Lands (https://www.spigotmc.org/resources/lands.53313/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.angeschossen</groupId>
|
||||
<artifactId>LandsAPI</artifactId>
|
||||
<version>6.28.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- ProtocolLib -->
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib</artifactId>
|
||||
<version>5.3.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Towny (https://www.spigotmc.org/resources/towny.72694/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.TownyAdvanced</groupId>
|
||||
<artifactId>Towny</artifactId>
|
||||
<version>0.98.6.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- GriefPrevention (https://www.spigotmc.org/resources/griefprevention.1884/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.TechFortress</groupId>
|
||||
<artifactId>GriefPrevention</artifactId>
|
||||
<version>17.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- KingdomsX (https://www.spigotmc.org/resources/kingdomsx.77670/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.cryptomorin</groupId>
|
||||
<artifactId>kingdoms</artifactId>
|
||||
<version>1.16.8.1.1</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>*</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- GriefDefender (https://www.spigotmc.org/resources/griefdefender.68900/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.bloodmc</groupId>
|
||||
<artifactId>GriefDefenderApi</artifactId>
|
||||
<version>920a610</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Peublos (https://www.spigotmc.org/resources/pueblos.91255/) -->
|
||||
<dependency>
|
||||
<groupId>com.github.SuperRonanCraft</groupId>
|
||||
<artifactId>Pueblos</artifactId>
|
||||
<version>97b96c9</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Particles Library
|
||||
https://github.com/ByteZ1337/ParticleLib
|
||||
(https://github.com/ByteZ1337/ParticleLib/blob/master/src/main/java/xyz/xenondevs/particle/ParticleEffect.java) -->
|
||||
<dependency>
|
||||
<groupId>xyz.xenondevs</groupId>
|
||||
<artifactId>particle</artifactId>
|
||||
<version>1.8.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Lombok Support (@Getter & @Setter)-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.38</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- EssentialsX -->
|
||||
<dependency>
|
||||
<groupId>net.essentialsx</groupId>
|
||||
<artifactId>EssentialsX</artifactId>
|
||||
<version>2.21.0</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Saber Factions (https://www.spigotmc.org/resources/saberfactions.69771/) (Added in 3.4.5)-->
|
||||
<dependency> <!-- WorldGuard screws up if updated -->
|
||||
<groupId>com.github.SaberLLC</groupId>
|
||||
<artifactId>Saber-Factions</artifactId>
|
||||
<version>2.4.0-RC</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-bukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- PlaceholderAPI Support (Added in 3.4.5)-->
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- HuskClaims (https://www.spigotmc.org/resources/huskclaims.114467/) (Added in 3.6.13)-->
|
||||
<dependency>
|
||||
<groupId>net.william278.huskclaims</groupId>
|
||||
<artifactId>huskclaims-bukkit</artifactId>
|
||||
<version>1.5.10</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Husktown (https://www.spigotmc.org/resources/husktowns.92672/) (Added in 3.4.5)-->
|
||||
<dependency>
|
||||
<groupId>net.william278.husktowns</groupId>
|
||||
<artifactId>husktowns-bukkit</artifactId>
|
||||
<version>3.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- MinePlots (https://builtbybit.com/resources/mineplots.21646/) (Added in 3.6.6 ) -->
|
||||
<dependency>
|
||||
<groupId>pl.minecodes.plots</groupId>
|
||||
<artifactId>plugin-api</artifactId>
|
||||
<version>3.4.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- FoliaLib -->
|
||||
<dependency>
|
||||
<groupId>com.tcoded</groupId>
|
||||
<artifactId>FoliaLib</artifactId>
|
||||
<version>0.5.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- FactionsBridge -->
|
||||
<dependency>
|
||||
<groupId>com.dansplugins.factionsystem</groupId>
|
||||
<artifactId>FactionsBridge</artifactId>
|
||||
<version>1.3.8</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/FactionsBridge-1.3.8.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.WhipDevelopment</groupId>
|
||||
<artifactId>CrashClaim</artifactId>
|
||||
<version>c697d3e9ef</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bekvon.bukkit.residence</groupId>
|
||||
<artifactId>Residence</artifactId>
|
||||
<version>5.1.4.1</version>
|
||||
<scope>system</scope>
|
||||
<optional>true</optional>
|
||||
<systemPath>${project.basedir}/../lib/Residence5.1.4.1.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+11
@@ -1,5 +1,8 @@
|
||||
package me.SuperRonanCraft.BetterRTP;
|
||||
|
||||
import com.ronanplugins.bettersync.editor.EditorClient;
|
||||
import com.ronanplugins.bettersync.editor.EditorSchema;
|
||||
|
||||
import lombok.Getter;
|
||||
import me.SuperRonanCraft.BetterRTP.player.PlayerInfo;
|
||||
import me.SuperRonanCraft.BetterRTP.player.commands.Commands;
|
||||
@@ -47,12 +50,19 @@ public class BetterRTP extends JavaPlugin {
|
||||
@Getter private boolean PlaceholderAPI;
|
||||
@Getter private final RTPLogger rtpLogger = new RTPLogger();
|
||||
@Getter private final FoliaHandler foliaHandler = new FoliaHandler();
|
||||
@Getter private EditorClient editorBridge;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
registerDependencies();
|
||||
loadAll();
|
||||
editorBridge = new EditorClient(
|
||||
this, EditorSchema.load(this, "META-INF/editor-schema.json"),
|
||||
EditorClient.website(this, "META-INF/betterrtp-editor.properties"),
|
||||
me.SuperRonanCraft.BetterRTP.versions.AsyncHandler::sync, this::reload,
|
||||
me.SuperRonanCraft.BetterRTP.references.PermissionNode.EDITOR::check,
|
||||
() -> me.SuperRonanCraft.BetterRTP.references.file.FileOther.FILETYPE.CONFIG.getConfig().saveToString());
|
||||
new Updater(this);
|
||||
new Metrics(this);
|
||||
listener.registerEvents(this);
|
||||
@@ -66,6 +76,7 @@ public class BetterRTP extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (editorBridge != null) editorBridge.close();
|
||||
invs.closeAll();
|
||||
queue.unload();
|
||||
rtpLogger.unload();
|
||||
File renamed without changes.
+4
-1
@@ -43,7 +43,10 @@ public class Commands {
|
||||
//Command Event
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
BetterRTP.debug(sendi.getName() + " executed: /" + label + " " + String.join(" ", args));
|
||||
boolean editorSync = args[0].equalsIgnoreCase("editorsync") ||
|
||||
(args[0].equalsIgnoreCase("addons") && args.length > 1 && args[1].equalsIgnoreCase("editorsync"));
|
||||
BetterRTP.debug(sendi.getName() + " executed: /" + label + " " +
|
||||
(editorSync ? (args[0].equalsIgnoreCase("addons") ? "addons editorsync [redacted]" : "editorsync [redacted]") : String.join(" ", args)));
|
||||
cmd.execute(sendi, label, args);
|
||||
Bukkit.getServer().getPluginManager().callEvent(new RTP_CommandEvent_After(sendi, cmd));
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+2
@@ -5,6 +5,8 @@ import me.SuperRonanCraft.BetterRTP.player.commands.types.*;
|
||||
public enum RTPCommandType {
|
||||
BIOME(new CmdBiome()),
|
||||
EDIT(new CmdEdit()),
|
||||
EDITOR(new CmdEditor()),
|
||||
EDITOR_SYNC(new CmdEditorSync()),
|
||||
HELP(new CmdHelp()),
|
||||
INFO(new CmdInfo()),
|
||||
LOCATION(new CmdLocation()),
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+28
@@ -0,0 +1,28 @@
|
||||
package me.SuperRonanCraft.BetterRTP.player.commands.types;
|
||||
|
||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommand;
|
||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommandHelpable;
|
||||
import me.SuperRonanCraft.BetterRTP.references.PermissionNode;
|
||||
import me.SuperRonanCraft.BetterRTP.references.messages.MessagesHelp;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdEditor implements RTPCommand, RTPCommandHelpable {
|
||||
public String getName() { return "editor"; }
|
||||
public PermissionNode permission() { return PermissionNode.EDITOR; }
|
||||
public List<String> tabComplete(CommandSender sender, String[] args) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
public void execute(CommandSender sender, String label, String[] args) {
|
||||
if (args.length == 1) BetterRTP.getInstance().getEditorBridge().upload(sender);
|
||||
else sender.sendMessage("Usage: /" + label + " editor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return MessagesHelp.EDITOR.get();
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package me.SuperRonanCraft.BetterRTP.player.commands.types;
|
||||
|
||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommand;
|
||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommandHelpable;
|
||||
import me.SuperRonanCraft.BetterRTP.references.PermissionNode;
|
||||
import me.SuperRonanCraft.BetterRTP.references.messages.MessagesHelp;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdEditorSync implements RTPCommand, RTPCommandHelpable {
|
||||
public String getName() { return "editorsync"; }
|
||||
public PermissionNode permission() { return PermissionNode.EDITOR; }
|
||||
public List<String> tabComplete(CommandSender sender, String[] args) { return Collections.emptyList(); }
|
||||
public void execute(CommandSender sender, String label, String[] args) {
|
||||
if (args.length == 2) BetterRTP.getInstance().getEditorBridge().redeem(sender, args[1]);
|
||||
else sender.sendMessage("Usage: /" + label + " editorsync <token>");
|
||||
}
|
||||
public String getHelp() { return MessagesHelp.EDITOR_SYNC.get(); }
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
@@ -22,6 +22,7 @@ public enum PermissionNode implements PermissionCheck {
|
||||
SIGN_CREATE("sign"),
|
||||
VERSION("version"),
|
||||
EDIT("edit"),
|
||||
EDITOR("editor"),
|
||||
LOCATION("location"),
|
||||
DEVELOPER("DEVELOPER_PERM"),
|
||||
;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 224 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user