mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-11-28 08:44:07 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48f211b1ad |
No files matched your search
@@ -1,37 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
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
|
run: cp settings.xml $HOME/.m2/settings.xml
|
||||||
|
|
||||||
- name: Build and test with Maven
|
- name: Build and test with Maven
|
||||||
run: mvn -B -pl :BetterRTP test
|
run: mvn test
|
||||||
@@ -10,5 +10,3 @@ BetterRTP.wiki/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.vscode/
|
.vscode/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
/dist/
|
|
||||||
@@ -1,431 +0,0 @@
|
|||||||
<?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>
|
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
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
@@ -1,21 +0,0 @@
|
|||||||
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(); }
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references;
|
|
||||||
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.depends.DepPerms;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
|
|
||||||
public class Permissions {
|
|
||||||
|
|
||||||
private final DepPerms depPerms = new DepPerms();
|
|
||||||
|
|
||||||
public void register() {
|
|
||||||
depPerms.register();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean checkPerm(String str, CommandSender sendi) {
|
|
||||||
return depPerms.hasPerm(str, sendi);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-96
@@ -1,96 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.database;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.player.playerdata.PlayerData;
|
|
||||||
|
|
||||||
public class DatabasePlayers extends SQLite {
|
|
||||||
|
|
||||||
public DatabasePlayers() {
|
|
||||||
super(DATABASE_TYPE.PLAYERS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getTables() {
|
|
||||||
List<String> list = new ArrayList<>();
|
|
||||||
list.add("Players");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum COLUMNS {
|
|
||||||
UUID("uuid", "varchar(32) PRIMARY KEY"),
|
|
||||||
//COOLDOWN DATA
|
|
||||||
COUNT("count", "long"),
|
|
||||||
LAST_COOLDOWN_DATE("last_rtp_date", "long"),
|
|
||||||
;
|
|
||||||
|
|
||||||
public final String name;
|
|
||||||
public final String type;
|
|
||||||
|
|
||||||
COLUMNS(String name, String type) {
|
|
||||||
this.name = name;
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setupData(PlayerData data) {
|
|
||||||
if (data == null || data.player == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Future<?> task = SQLiteExecutor.EXECUTOR.submit(() -> {
|
|
||||||
Connection conn = null;
|
|
||||||
PreparedStatement ps = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
try {
|
|
||||||
conn = getSQLConnection();
|
|
||||||
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0) + " WHERE " + COLUMNS.UUID.name + " = ?");
|
|
||||||
ps.setString(1, data.player.getUniqueId().toString());
|
|
||||||
|
|
||||||
rs = ps.executeQuery();
|
|
||||||
if (rs.next()) {
|
|
||||||
long count = rs.getLong(COLUMNS.COUNT.name);
|
|
||||||
long time = rs.getLong(COLUMNS.LAST_COOLDOWN_DATE.name);
|
|
||||||
data.setRtpCount(Math.toIntExact(count));
|
|
||||||
data.setGlobalCooldown(time);
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
|
||||||
} finally {
|
|
||||||
close(ps, rs, conn);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
task.get();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set a player Cooldown
|
|
||||||
public void setData(PlayerData data) {
|
|
||||||
try {
|
|
||||||
SQLiteExecutor.EXECUTOR.submit(() -> {
|
|
||||||
String sql = "INSERT OR REPLACE INTO " + tables.get(0) + " ("
|
|
||||||
+ COLUMNS.UUID.name + ", "
|
|
||||||
+ COLUMNS.COUNT.name + ", "
|
|
||||||
+ COLUMNS.LAST_COOLDOWN_DATE.name + ") VALUES(?, ?, ?)";
|
|
||||||
List<Object> params = new ArrayList<Object>() {{
|
|
||||||
add(data.player.getUniqueId().toString());
|
|
||||||
add(data.getRtpCount());
|
|
||||||
add(data.getGlobalCooldown());
|
|
||||||
}};
|
|
||||||
sqlUpdate(sql, params);
|
|
||||||
});
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-184
@@ -1,184 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.database;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueData;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueGenerator;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueHandler;
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.RTPWorld;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
public class DatabaseQueue extends SQLite {
|
|
||||||
|
|
||||||
public DatabaseQueue() {
|
|
||||||
super(DATABASE_TYPE.QUEUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> getTables() {
|
|
||||||
List<String> list = new ArrayList<>();
|
|
||||||
list.add("Queue");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum COLUMNS {
|
|
||||||
ID("id", "integer PRIMARY KEY AUTOINCREMENT"),
|
|
||||||
//Location Data
|
|
||||||
X("x", "long"),
|
|
||||||
Z("z", "long"),
|
|
||||||
WORLD("world", "varchar(32)"),
|
|
||||||
GENERATED("generated", "long")
|
|
||||||
;
|
|
||||||
|
|
||||||
public final String name;
|
|
||||||
public final String type;
|
|
||||||
|
|
||||||
COLUMNS(String name, String type) {
|
|
||||||
this.name = name;
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public void load() {
|
|
||||||
if (QueueHandler.isEnabled())
|
|
||||||
super.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<QueueData> getInRange(QueueRangeData range) {
|
|
||||||
final List<QueueData> queueDataList = new ArrayList<>();
|
|
||||||
try {
|
|
||||||
SQLiteExecutor.EXECUTOR.submit(() -> {
|
|
||||||
Connection conn = null;
|
|
||||||
PreparedStatement ps = null;
|
|
||||||
ResultSet rs = null;
|
|
||||||
try {
|
|
||||||
conn = getSQLConnection();
|
|
||||||
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0) + " WHERE "
|
|
||||||
+ COLUMNS.WORLD.name + " = '" + range.getWorld().getName() + "' AND "
|
|
||||||
+ COLUMNS.X.name + " BETWEEN " + range.getXLow() + " AND " + range.getXHigh()
|
|
||||||
+ " AND " + COLUMNS.Z.name + " BETWEEN " + range.getZLow() + " AND " + range.getZHigh()
|
|
||||||
+ " ORDER BY RANDOM() LIMIT " + (QueueGenerator.queueMax + 1)
|
|
||||||
);
|
|
||||||
rs = ps.executeQuery();
|
|
||||||
while (rs.next()) {
|
|
||||||
long x = rs.getLong(COLUMNS.X.name);
|
|
||||||
long z = rs.getLong(COLUMNS.Z.name);
|
|
||||||
String worldName = rs.getString(COLUMNS.WORLD.name);
|
|
||||||
int id = rs.getInt(COLUMNS.ID.name);
|
|
||||||
long generated = rs.getLong(COLUMNS.GENERATED.name);
|
|
||||||
World world = Bukkit.getWorld(worldName);
|
|
||||||
if (world != null) {
|
|
||||||
queueDataList.add(new QueueData(new Location(world, x, 69, z), generated, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
|
||||||
} finally {
|
|
||||||
close(ps, rs, conn);
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
return queueDataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set a queue to save
|
|
||||||
public QueueData addQueue(Location loc) {
|
|
||||||
try {
|
|
||||||
return SQLiteExecutor.EXECUTOR.submit(() -> {
|
|
||||||
String sql = "INSERT INTO " + tables.get(0) + " ("
|
|
||||||
+ COLUMNS.X.name + ", "
|
|
||||||
+ COLUMNS.Z.name + ", "
|
|
||||||
+ COLUMNS.WORLD.name + ", "
|
|
||||||
+ COLUMNS.GENERATED.name + ") VALUES(?, ?, ?, ?)";
|
|
||||||
List<Object> params = new ArrayList<Object>() {{
|
|
||||||
add(loc.getBlockX());
|
|
||||||
add(loc.getBlockZ());
|
|
||||||
add(loc.getWorld().getName());
|
|
||||||
add(System.currentTimeMillis());
|
|
||||||
}};
|
|
||||||
int database_id = createQueue(sql, params);
|
|
||||||
return database_id >= 0 ? new QueueData(loc, System.currentTimeMillis(), database_id) : null;
|
|
||||||
}).get();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int createQueue(String statement, @NonNull List<Object> params) {
|
|
||||||
Connection conn = null;
|
|
||||||
PreparedStatement ps = null;
|
|
||||||
int id = -1;
|
|
||||||
try {
|
|
||||||
conn = getSQLConnection();
|
|
||||||
ps = conn.prepareStatement(statement, Statement.RETURN_GENERATED_KEYS);
|
|
||||||
Iterator<Object> it = params.iterator();
|
|
||||||
int paramIndex = 1;
|
|
||||||
while (it.hasNext()) {
|
|
||||||
ps.setObject(paramIndex, it.next());
|
|
||||||
paramIndex++;
|
|
||||||
}
|
|
||||||
ps.executeUpdate();
|
|
||||||
ResultSet rs = ps.getGeneratedKeys();
|
|
||||||
if (rs.next()) {
|
|
||||||
id = rs.getInt(1);
|
|
||||||
}
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
|
||||||
} finally {
|
|
||||||
close(ps, null, conn);
|
|
||||||
}
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean removeLocation(Location loc) {
|
|
||||||
try {
|
|
||||||
return SQLiteExecutor.EXECUTOR.submit(() -> {
|
|
||||||
String sql = "DELETE FROM " + tables.get(0) + " WHERE "
|
|
||||||
+ COLUMNS.X.name + " = ? AND "
|
|
||||||
+ COLUMNS.Z.name + " = ? AND "
|
|
||||||
+ COLUMNS.WORLD.name + " = ?";
|
|
||||||
List<Object> params = new ArrayList<Object>() {{
|
|
||||||
add(loc.getBlockX());
|
|
||||||
add(loc.getBlockZ());
|
|
||||||
add(loc.getWorld().getName());
|
|
||||||
}};
|
|
||||||
return sqlUpdate(sql, params);
|
|
||||||
}).get();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
public static class QueueRangeData {
|
|
||||||
|
|
||||||
int xLow, xHigh;
|
|
||||||
int zLow, zHigh;
|
|
||||||
World world;
|
|
||||||
|
|
||||||
public QueueRangeData(RTPWorld rtpWorld) {
|
|
||||||
this.xLow = rtpWorld.getCenterX() - rtpWorld.getMaxRadius();
|
|
||||||
this.xHigh = rtpWorld.getCenterX() + rtpWorld.getMaxRadius();
|
|
||||||
this.zLow = rtpWorld.getCenterZ() - rtpWorld.getMaxRadius();
|
|
||||||
this.zHigh = rtpWorld.getCenterZ() + rtpWorld.getMaxRadius();
|
|
||||||
this.world = rtpWorld.getWorld();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.database;
|
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
|
|
||||||
public class SQLiteExecutor {
|
|
||||||
public static final ExecutorService EXECUTOR = Executors.newSingleThreadExecutor();
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
|
|
||||||
|
|
||||||
import net.william278.huskclaims.BukkitHuskClaims;
|
|
||||||
import net.william278.huskclaims.api.BukkitHuskClaimsAPI;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
|
|
||||||
public class RTP_HuskClaims implements RegionPluginCheck {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean check(Location loc) {
|
|
||||||
boolean result = true;
|
|
||||||
if (REGIONPLUGINS.HUSKCLAIMS.isEnabled()) {
|
|
||||||
try {
|
|
||||||
result = !BukkitHuskClaimsAPI.getInstance().getClaimAt(BukkitHuskClaims.Adapter.adapt(loc)).isPresent();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# Build metadata embedded in the JAR; not a server configuration file.
|
|
||||||
website=${editor.website}
|
|
||||||
@@ -1,397 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
||||||
"$id": "https://schemas.ronanplugins.com/betterrtp/2",
|
|
||||||
"title": "BetterRTP editor configuration",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Settings": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Respect": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"MinePlots": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"WorldGuard": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"GriefPrevention": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Towny": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"RedProtect": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"FactionsUUID": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Lands": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Residence": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"KingdomsX": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"hClaims": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"GriefDefender": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"UltimateClaims": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Pueblos": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"SaberFactions": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"HuskClaims": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"HuskTowns": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"FactionsBridge": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"CrashClaim": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Debugger": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"PreloadRadius": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"MaxAttempts": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"RtpOnFirstJoin": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"World": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"SetAsRespawn": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Cooldown": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"LockAfter": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Time": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"PerWorld": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Delay": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Time": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"CancelOnMove": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Queue": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DisableUpdater": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Logger": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"LogToConsole": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Format": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Default": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Biomes": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"UseWorldBorder": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"MaxRadius": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"MinRadius": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"CenterX": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"CenterZ": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Shape": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"MaxY": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"MinY": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"RTPOnDeath": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Language-File": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Change the language file locally."
|
|
||||||
},
|
|
||||||
"BlacklistedBlocks": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DisabledWorlds": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Overrides": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "overrides"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WorldType": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"NORMAL",
|
|
||||||
"NETHER"
|
|
||||||
],
|
|
||||||
"x-caseInsensitive": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "types"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"CustomWorlds": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"UseWorldBorder": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"MaxRadius": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 1000
|
|
||||||
},
|
|
||||||
"MinRadius": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 10
|
|
||||||
},
|
|
||||||
"CenterX": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"CenterZ": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Price": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Shape": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "square"
|
|
||||||
},
|
|
||||||
"MaxY": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 320
|
|
||||||
},
|
|
||||||
"MinY": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Cooldown": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"RTPOnDeath": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"Biomes": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editableProperties": true,
|
|
||||||
"x-inherit": "Default"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "worlds"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"PermissionGroup": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Groups": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"UseWorldBorder": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"MaxRadius": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 1000
|
|
||||||
},
|
|
||||||
"MinRadius": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 10
|
|
||||||
},
|
|
||||||
"CenterX": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"CenterZ": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Price": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Shape": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "square"
|
|
||||||
},
|
|
||||||
"MaxY": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 320
|
|
||||||
},
|
|
||||||
"MinY": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Cooldown": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"RTPOnDeath": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"Biomes": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Priority": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editableProperties": true,
|
|
||||||
"x-inherit": "Default"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "worlds"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "groups"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-bettersync": {
|
|
||||||
"format": 1,
|
|
||||||
"plugin": "betterrtp",
|
|
||||||
"schemaVersion": "2",
|
|
||||||
"displayName": "BetterRTP"
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"Settings",
|
|
||||||
"Default"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
# Ajude a traduzir este arquivo para mais idiomas!
|
|
||||||
Messages:
|
|
||||||
Prefix: '&7[&6BetterRTP&7] '
|
|
||||||
Success: ## Marcadores! %x% %y% e %z% são as coordenadas x, y, e z para as quais o jogador está sendo teleportado! #
|
|
||||||
Paid: '&aVocê foi teleportado para&7 x=%x% y=%y% z=%z% por &c$%price%&7!'
|
|
||||||
Bypass: '&aVocê foi teleportado para&7 x=%x% y=%y% z=%z%'
|
|
||||||
Loading: '&aLocal seguro localizado! &7Carregando chunks...'
|
|
||||||
Teleport: '&aTeleportando... &fpor favor, aguarde enquanto encontramos um local seguro!'
|
|
||||||
Failed:
|
|
||||||
Price: '&cNão foi possível teletransportar porque não há fundos suficientes! &7Você precisa de pelo menos $%price% &7para rtp!'
|
|
||||||
NotSafe: '&cNão foi possível encontrar um local seguro em %attempts% tentativas! &7Você não foi teleportado!'
|
|
||||||
Hunger: '&cNão foi possível teletransportar porque você está... &7com fome demais&c, coma algo!'
|
|
||||||
Other:
|
|
||||||
Success: '&a%player% foi teleportado para&7 x=%x% y=%y% z=%z%'
|
|
||||||
NotSafe: '&cNão foi possível encontrar um local seguro em %attempts% tentativas! &7%player% não foi teleportado!'
|
|
||||||
Biome: '&cParece que o bioma&7 %biome%&c não existe! &7Tente usar a lista de abas!'
|
|
||||||
Reload: '&eConfiguração recarregada com sucesso!'
|
|
||||||
Update: '&7Há uma atualização disponível para &6BetterRTP &7versão &e#%newVersion% &7você tem a versão &e#%currentVersion%'
|
|
||||||
NoPermission:
|
|
||||||
Basic: '&cDesculpe! &7Você não tem permissão para usar este comando! &8Permissão: %permission%'
|
|
||||||
World: '&cDesculpe! &7Você não tem permissão para rtp no mundo %world%! &8Permissão: %permission%'
|
|
||||||
DisabledWorld: '&cMundo desativado %world%! &7Não foi possível teleportar!'
|
|
||||||
Cooldown: '&cDesculpe! &7Você não pode usar rtp por mais &c%time%&7!'
|
|
||||||
Locked: '&cDesculpe! &7Você já usou todos os seus RTPs!'
|
|
||||||
Invalid: '&cArgumento inválido. Tente ''/%command% help'''
|
|
||||||
NotOnline: '&cO jogador &7%player% &cnão está online!'
|
|
||||||
Delay: '&aTeleportando em &f%time% &asegundos! Não se mova!'
|
|
||||||
Moved: '&cVocê se moveu! &7O RTP foi cancelado!'
|
|
||||||
NotExist: '&cParece que o mundo &7%world% &cnão existe!'
|
|
||||||
Already: '&cOps! &7Parece que você já está usando rtp, tenha um pouco de paciência!'
|
|
||||||
Sign: '&7Sinal de comando criado! &7O comando é... ''&f/rtp %command%&7'''
|
|
||||||
Edit:
|
|
||||||
Error: '&cErro! &7Entrada inválida fornecida!'
|
|
||||||
Set: '&bSucesso! &7%type% definido para %value%'
|
|
||||||
Remove: '&cRemovido! &7Você removeu o Mundo Personalizado %world%'
|
|
||||||
|
|
||||||
Help:
|
|
||||||
Prefix: '&e&m-----&6&l BetterRTP &8| Ajuda &e&m-----'
|
|
||||||
Main: ' &7- &e/%command% &7- Teletransporta você aleatoriamente!'
|
|
||||||
Biome: ' &7- &e/%command% biome <biome1, biome2...> &7- Teletransporta aleatoriamente dentro desses biomas'
|
|
||||||
Edit: ' &7- &e/%command% edit <default/world> [args...] &7- Edita algumas configurações do plugin'
|
|
||||||
Help: ' &7- &e/%command% help &7- Mostra a lista de ajuda'
|
|
||||||
Info: ' &7- &e/%command% info [world/particles/shapes/potion_effects] &7- Visualiza informações específicas sobre parâmetros do plugin'
|
|
||||||
Player: ' &7- &e/%command% player <player> [world] [biome1, biome2...] &7- Teletransporta outro jogador aleatoriamente'
|
|
||||||
Reload: ' &7- &e/%command% reload &7- Recarrega o plugin'
|
|
||||||
Settings: ' &7- &e/%command% settings &7- Abre uma GUI para editar algumas configurações'
|
|
||||||
Test: ' &7- &e/%command% test &7- Testa os efeitos do plugin após um teletransporte sem se mover'
|
|
||||||
Version: ' &7- &e/%command% version &7- Visualiza a versão atual em execução'
|
|
||||||
World: ' &7- &e/%command% world <world> [biome1, biome2...] &7- Teletransporta aleatoriamente em outro mundo'
|
|
||||||
Location: ' &7- &e/%command% location <location_name> &7- Teletransporta usando uma localização específica'
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
Player: '&cUso&7: /%command% player <player> [world] [biome1, biome2]'
|
|
||||||
World: '&cUso&7: /%command% world <world> [biome1, biome2...]'
|
|
||||||
Biome: '&cUso&7: /%command% biome <biome1, biome2...>'
|
|
||||||
Location: '&cUso&7: /%command% location <location_name>'
|
|
||||||
Edit:
|
|
||||||
Base: '&cUso&7: /%command% edit <default/world> [args...]'
|
|
||||||
Default: '&cUso&7: /%command% edit default <max/min/useworldborder/center> <value>'
|
|
||||||
World: '&cUso&7: /%command% edit customworld <world> <max/min/useworldborder/center> <value>'
|
|
||||||
PermissionGroup: '&cUso&7: /%command% edit permission_group <group> <world> <max/min/useworldborder/center> <value>'
|
|
||||||
Location: '&cUso&7: /%command% edit location <location_name> <max/min/useworldborder/center> <value>'
|
|
||||||
Worldtype: '&cUso&7: /%command% edit world_type <world> <NETHER/NORMAL>'
|
|
||||||
Override: '&cUso&7: /%command% edit override <world> <world_to>'
|
|
||||||
BlacklistedBlocks: '&cUso&7: /%command% edit blacklistedblocks <add/remove> <block_id>'
|
|
||||||
@@ -5,20 +5,6 @@
|
|||||||
BetterRTP-Addons is a paid resource, adding optional middleware to BetterRTP to help financially support the developement of BetterRTP.
|
BetterRTP-Addons is a paid resource, adding optional middleware to BetterRTP to help financially support the developement of BetterRTP.
|
||||||
But this can be compiled free of charge if you know how to compile maven resources!
|
But this can be compiled free of charge if you know how to compile maven resources!
|
||||||
|
|
||||||
## Web configuration editor
|
|
||||||
|
|
||||||
[Open the BetterRTP Addons editor](https://www.minecentral.net/editor/betterrtp-addons) to start with defaults or upload config.yml. Edit addon toggles, menus, command lists, and flashback warnings. Install the matching updated BetterRTP JAR too: Addons shares its editor bridge.
|
|
||||||
|
|
||||||
1. Run `/rtp addons editor` on your server and open the private link it returns.
|
|
||||||
2. Edit the form or YAML and choose **Save and get sync command**.
|
|
||||||
3. Run `/betterrtp addons editorsync <token>` in Minecraft to apply that saved version.
|
|
||||||
|
|
||||||
Console and players with `betterrtp.addon.editor` (default: op) can use both commands. No account or premium is required for editing, downloading, or command sync. Upload links last 24 hours; each sync command works once and expires after 15 minutes. Keep links and commands private.
|
|
||||||
|
|
||||||
Sync validates config.yml, saves a backup in `editor-backups`, then replaces the file and reloads the plugin. Nothing changes until the sync command runs. If reload fails after writing, the new file remains in place and Minecraft reports the error.
|
|
||||||
|
|
||||||
Shared behavior, deployment, and verification are documented in the [webapp repository](https://github.com/RonanPlugins/BetterRTP-Webapp/blob/main/docs/web-editor.md#addons-deployment).
|
|
||||||
|
|
||||||
## Where's the Lang files?/Want to Contribute translating?
|
## Where's the Lang files?/Want to Contribute translating?
|
||||||
All language files are located [here](src/main/resources/lang)
|
All language files are located [here](src/main/resources/lang)
|
||||||
feel free to fork one of the language files and help translate!
|
feel free to fork one of the language files and help translate!
|
||||||
@@ -42,5 +28,3 @@ The wiki is available [here](../../../wiki)!
|
|||||||
<br/>
|
<br/>
|
||||||
<b><i><a href="https://www.spigotmc.org/resources/authors/superronancraft.13025/">Check out my other plugins!</a></i></b>
|
<b><i><a href="https://www.spigotmc.org/resources/authors/superronancraft.13025/">Check out my other plugins!</a></i></b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Build both BetterRTP and Addons together by running `mvn clean package` from the parent BetterRTP directory. Both finished JARs are written to the parent directory’s `dist/` folder.
|
|
||||||
+14
-82
@@ -7,26 +7,13 @@
|
|||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTPAddons</artifactId>
|
<artifactId>BetterRTPAddons</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.8.10</version>
|
<version>1.8.8</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<editor.website>https://www.minecentral.net</editor.website>
|
|
||||||
<bettersync.version>2.0.0</bettersync.version>
|
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>dev</id>
|
|
||||||
<build><plugins><plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.2.0</version>
|
|
||||||
<configuration><outputDirectory>../../../Java/plugins</outputDirectory></configuration>
|
|
||||||
</plugin></plugins></build>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
@@ -36,14 +23,6 @@
|
|||||||
</resources>
|
</resources>
|
||||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
<plugins>
|
<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>
|
<plugin>
|
||||||
<!-- Shade PaperLib into project -->
|
<!-- Shade PaperLib into project -->
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@@ -52,8 +31,6 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation><pattern>com.ronanplugins.bettersync</pattern><shadedPattern>me.SuperRonanCraft.BetterRTPAddons.lib.bettersync</shadedPattern></relocation>
|
|
||||||
|
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>io.papermc.lib</pattern>
|
<pattern>io.papermc.lib</pattern>
|
||||||
<shadedPattern>me.SuperRonanCraft.BetterRTPAddons.paperlib</shadedPattern>
|
<shadedPattern>me.SuperRonanCraft.BetterRTPAddons.paperlib</shadedPattern>
|
||||||
@@ -69,6 +46,15 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<!-- Local Server Building -->
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>../../../Java/plugins</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@@ -78,49 +64,10 @@
|
|||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
|
||||||
<id>minecodes-repository-releases</id>
|
|
||||||
<url>https://repository.minecodes.pl/releases</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
@@ -128,22 +75,15 @@
|
|||||||
<!-- PaperMC Repo -->
|
<!-- PaperMC Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<!-- ProtocolLib Repo -->
|
<!-- ProtocolLib Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>dmulloy2-repo</id>
|
<id>dmulloy2-repo</id>
|
||||||
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository><id>jitpack.io</id><url>https://jitpack.io</url></repository>
|
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<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-->
|
<!--Spigot API-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
@@ -162,14 +102,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc</groupId>
|
<groupId>io.papermc</groupId>
|
||||||
<artifactId>paperlib</artifactId>
|
<artifactId>paperlib</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.5</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- BetterRTP -->
|
<!-- BetterRTP -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
<version>3.6.13</version>
|
<version>LATEST</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- ProtocolLib -->
|
<!-- ProtocolLib -->
|
||||||
@@ -178,19 +118,11 @@
|
|||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>4.5.0</version>
|
<version>4.5.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
|
||||||
<!-- ProtocolLib supplies its executor implementation; Addons does not use it.
|
|
||||||
Its legacy transitive snapshot is no longer available to fresh builds. -->
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.comphenix.executors</groupId>
|
|
||||||
<artifactId>BukkitExecutors</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.38</version>
|
<version>1.18.22</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -33,14 +33,6 @@ public class AddonsCommand implements RTPCommand, RTPCommandHelpable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(CommandSender sendi, String label, String[] args) {
|
public void execute(CommandSender sendi, String label, String[] args) {
|
||||||
if (args.length >= 2 && (args[1].equalsIgnoreCase("editor") || args[1].equalsIgnoreCase("editorsync"))) {
|
|
||||||
Main plugin = Main.getInstance();
|
|
||||||
if (!plugin.canEdit(sendi)) { sendi.sendMessage("§cYou need betterrtp.addon.editor permission."); return; }
|
|
||||||
if (args[1].equalsIgnoreCase("editor") && args.length == 2) plugin.getEditorBridge().upload(sendi);
|
|
||||||
else if (args[1].equalsIgnoreCase("editorsync") && args.length == 3) plugin.getEditorBridge().redeem(sendi, args[2]);
|
|
||||||
else sendi.sendMessage("§eUsage: /" + label + " addons " + (args[1].equalsIgnoreCase("editor") ? "editor" : "editorsync <token>"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
for (AddonCmds cmds : AddonCmds.values()) {
|
for (AddonCmds cmds : AddonCmds.values()) {
|
||||||
if (cmds.name().equalsIgnoreCase(args[1])) {
|
if (cmds.name().equalsIgnoreCase(args[1])) {
|
||||||
@@ -52,7 +44,6 @@ public class AddonsCommand implements RTPCommand, RTPCommandHelpable {
|
|||||||
} else {
|
} else {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add(MessagesHelp.PREFIX.get());
|
list.add(MessagesHelp.PREFIX.get());
|
||||||
addEditorHelp(sendi, label, list);
|
|
||||||
for (AddonsHandler.Addons addon : Main.getInstance().getAddonsHandler().addons) {
|
for (AddonsHandler.Addons addon : Main.getInstance().getAddonsHandler().addons) {
|
||||||
RTPCommand cmd = addon.getCmd();
|
RTPCommand cmd = addon.getCmd();
|
||||||
if (cmd instanceof RTPCommandHelpable)
|
if (cmd instanceof RTPCommandHelpable)
|
||||||
@@ -66,10 +57,6 @@ public class AddonsCommand implements RTPCommand, RTPCommandHelpable {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> tabComplete(CommandSender sendi, String[] args) {
|
public List<String> tabComplete(CommandSender sendi, String[] args) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
if (args.length == 2 && Main.getInstance().canEdit(sendi)) {
|
|
||||||
for (String command : new String[] { "editor", "editorsync" })
|
|
||||||
if (command.startsWith(args[1].toLowerCase(Locale.ROOT))) list.add(command);
|
|
||||||
}
|
|
||||||
if (args.length == 2)
|
if (args.length == 2)
|
||||||
for (AddonCmds cmds : AddonCmds.values()) {
|
for (AddonCmds cmds : AddonCmds.values()) {
|
||||||
if (cmds.name().toLowerCase().startsWith(args[1].toLowerCase()))
|
if (cmds.name().toLowerCase().startsWith(args[1].toLowerCase()))
|
||||||
@@ -78,13 +65,6 @@ public class AddonsCommand implements RTPCommand, RTPCommandHelpable {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addEditorHelp(CommandSender sender, String label, List<String> list) {
|
|
||||||
if (Main.getInstance().canEdit(sender)) {
|
|
||||||
list.add("§7- §e/" + label + " addons editor §7- Open the Addons web editor");
|
|
||||||
list.add("§7- §e/" + label + " addons editorsync <token> §7- Apply a saved Addons config");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PermissionNode permission() {
|
public PermissionNode permission() {
|
||||||
return PermissionNode.USE;
|
return PermissionNode.USE;
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ public class AddonsHandler {
|
|||||||
//addonCount++;
|
//addonCount++;
|
||||||
}
|
}
|
||||||
//Main.getInstance().getLogger().log(Level.INFO, addonCount + "/" + Addons.values().length + " addons were enabled!");
|
//Main.getInstance().getLogger().log(Level.INFO, addonCount + "/" + Addons.values().length + " addons were enabled!");
|
||||||
if (!BetterRTP.getInstance().getCmd().commands.contains(cmd))
|
HelperRTP_Command.registerCommand(cmd, false);
|
||||||
HelperRTP_Command.registerCommand(cmd, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unload() {
|
public void unload() {
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
package me.SuperRonanCraft.BetterRTPAddons;
|
package me.SuperRonanCraft.BetterRTPAddons;
|
||||||
|
|
||||||
import com.ronanplugins.bettersync.editor.EditorClient;
|
|
||||||
import com.ronanplugins.bettersync.editor.EditorSchema;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.util.Files;
|
import me.SuperRonanCraft.BetterRTPAddons.util.Files;
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.util.ReloadListener;
|
import me.SuperRonanCraft.BetterRTPAddons.util.ReloadListener;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -11,37 +7,21 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
|
|
||||||
@Getter
|
|
||||||
private static Main instance;
|
private static Main instance;
|
||||||
@Getter
|
|
||||||
private final AddonsHandler addonsHandler = new AddonsHandler();
|
private final AddonsHandler addonsHandler = new AddonsHandler();
|
||||||
@Getter
|
|
||||||
private final Files files = new Files();
|
private final Files files = new Files();
|
||||||
public final AddonMessages msgs = new AddonMessages();
|
public final AddonMessages msgs = new AddonMessages();
|
||||||
private final ReloadListener reloadListener = new ReloadListener();
|
private final ReloadListener reloadListener = new ReloadListener();
|
||||||
|
|
||||||
@Getter
|
|
||||||
private EditorClient editorBridge;
|
|
||||||
|
|
||||||
public boolean canEdit(org.bukkit.command.CommandSender sender) {
|
|
||||||
return !(sender instanceof org.bukkit.entity.Player) || sender.hasPermission("betterrtp.addon.editor");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
Bukkit.getPluginManager().registerEvents(reloadListener, this);
|
Bukkit.getPluginManager().registerEvents(reloadListener, this);
|
||||||
load();
|
load();
|
||||||
editorBridge = new EditorClient(
|
|
||||||
this, EditorSchema.load(this, "META-INF/editor-schema.json"),
|
|
||||||
EditorClient.website(this, "META-INF/betterrtp-addons-editor.properties"),
|
|
||||||
me.SuperRonanCraft.BetterRTP.versions.AsyncHandler::sync, sender -> load(),
|
|
||||||
this::canEdit, () -> Files.FILETYPE.CONFIG.getConfig().saveToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (editorBridge != null) editorBridge.close();
|
|
||||||
addonsHandler.unload();
|
addonsHandler.unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,4 +30,15 @@ public class Main extends JavaPlugin {
|
|||||||
addonsHandler.load();
|
addonsHandler.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Files getFiles() {
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddonsHandler getAddonsHandler() {
|
||||||
|
return addonsHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Main getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
-1
@@ -21,7 +21,6 @@ public class AddonsCommand_Help implements AddonsCommands, RTPCommandHelpable {
|
|||||||
public void execute(CommandSender sendi, String label, String[] args) {
|
public void execute(CommandSender sendi, String label, String[] args) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add(MessagesHelp.PREFIX.get());
|
list.add(MessagesHelp.PREFIX.get());
|
||||||
AddonsCommand.addEditorHelp(sendi, label, list);
|
|
||||||
for (AddonsCommand.AddonCmds cmds : AddonsCommand.AddonCmds.values()) {
|
for (AddonsCommand.AddonCmds cmds : AddonsCommand.AddonCmds.values()) {
|
||||||
if (cmds.cmd instanceof RTPCommandHelpable)
|
if (cmds.cmd instanceof RTPCommandHelpable)
|
||||||
list.add(((RTPCommandHelpable) cmds.cmd).getHelp().replace("%command%", label));
|
list.add(((RTPCommandHelpable) cmds.cmd).getHelp().replace("%command%", label));
|
||||||
|
|||||||
+8
@@ -1,9 +1,17 @@
|
|||||||
package me.SuperRonanCraft.BetterRTPAddons.cmds;
|
package me.SuperRonanCraft.BetterRTPAddons.cmds;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.player.commands.RTPCommandHelpable;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.messages.Message;
|
||||||
|
import me.SuperRonanCraft.BetterRTPAddons.AddonMessages;
|
||||||
|
import me.SuperRonanCraft.BetterRTPAddons.AddonsHandler;
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.Main;
|
import me.SuperRonanCraft.BetterRTPAddons.Main;
|
||||||
import me.SuperRonanCraft.BetterRTPAddons.util.Message_ADDONS;
|
import me.SuperRonanCraft.BetterRTPAddons.util.Message_ADDONS;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class AddonsCommand_Version implements AddonsCommands {
|
public class AddonsCommand_Version implements AddonsCommands {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
website=${editor.website}
|
|
||||||
@@ -1,245 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
||||||
"$id": "https://schemas.ronanplugins.com/betterrtp-addons/2",
|
|
||||||
"title": "BetterRTP Addons editor configuration",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Flashback": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Timer": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Delay": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Warnings": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "warnings"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Logger": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Format": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"LogToConsole": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Portals": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"IgnoreDelay": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"IgnoreCooldown": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ExtraEffects": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"YOffset": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Offset": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"MagicStick": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"GiveFirstJoin": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Amount": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Item": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Material": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Lore": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Take": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Commands": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Events": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Teleport": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Commands": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Cancelled": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Commands": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Parties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"RTPMenu": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Lines": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"AutoRefresh": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"WorldList": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Name": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
"Item": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "MAP"
|
|
||||||
},
|
|
||||||
"Slot": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"Lore": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"default": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editableProperties": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-editor": {
|
|
||||||
"collection": "menu"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Enabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"Title": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"AutoCenter": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Language-File": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Change the language file locally."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-bettersync": {
|
|
||||||
"format": 1,
|
|
||||||
"plugin": "betterrtp-addons",
|
|
||||||
"schemaVersion": "2",
|
|
||||||
"displayName": "BetterRTP Addons"
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"Flashback",
|
|
||||||
"Logger",
|
|
||||||
"Portals",
|
|
||||||
"ExtraEffects",
|
|
||||||
"MagicStick",
|
|
||||||
"Commands",
|
|
||||||
"Parties",
|
|
||||||
"RTPMenu"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -7,9 +7,6 @@ depend: [BetterRTP]
|
|||||||
softdepend: [ProtocolLib]
|
softdepend: [ProtocolLib]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
betterrtp.addon.editor:
|
|
||||||
description: Open and sync the BetterRTP Addons web editor
|
|
||||||
default: op
|
|
||||||
betterrtp.addon.portals:
|
betterrtp.addon.portals:
|
||||||
description: Ability to use the portals addon commands
|
description: Ability to use the portals addon commands
|
||||||
|
|
||||||
@@ -2,22 +2,8 @@
|
|||||||
<b><a>Welcome to BetterRTP's repository!</a></b>
|
<b><a>Welcome to BetterRTP's repository!</a></b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Web configuration editor
|
|
||||||
|
|
||||||
[Open the BetterRTP editor](https://www.minecentral.net/editor/betterrtp) to start with defaults or upload config.yml. Edit world settings, teleport ranges, cooldowns, and supported lists.
|
|
||||||
|
|
||||||
1. Run `/rtp editor` on your server and open the private link it returns.
|
|
||||||
2. Edit the form or YAML and choose **Save and get sync command**.
|
|
||||||
3. Run `/betterrtp editorsync <token>` in Minecraft to apply that saved version.
|
|
||||||
|
|
||||||
Console and players with `betterrtp.editor` (default: op) can use both commands. No account or premium is required for editing, downloading, or command sync. Upload links last 24 hours; each sync command works once and expires after 15 minutes. Keep links and commands private.
|
|
||||||
|
|
||||||
Sync validates config.yml, saves a backup in `editor-backups`, then replaces the file and reloads the plugin. Nothing changes until the sync command runs. If reload fails after writing, the new file remains in place and Minecraft reports the error.
|
|
||||||
|
|
||||||
Shared behavior, deployment, and verification are documented in the [webapp repository](https://github.com/RonanPlugins/BetterRTP-Webapp/blob/main/docs/web-editor.md).
|
|
||||||
|
|
||||||
## Where's the Lang files?/Want to Contribute translating?
|
## Where's the Lang files?/Want to Contribute translating?
|
||||||
All language files are located [here](BetterRTP-Core/src/main/resources/lang)
|
All language files are located [here](src/main/resources/lang)
|
||||||
feel free to fork one of the language files and help translate!
|
feel free to fork one of the language files and help translate!
|
||||||
|
|
||||||
## Libraries
|
## Libraries
|
||||||
@@ -29,14 +15,9 @@ BetterRTP uses and is compiled with the following libraries:
|
|||||||
|
|
||||||
## Build instructions on Ubuntu
|
## Build instructions on Ubuntu
|
||||||
|
|
||||||
From this directory, run `mvn clean package` to build BetterRTP followed by BetterRTP Addons. Maven resolves Addons against the BetterRTP built in the same run; a separate `install` step is unnecessary.
|
mvn clean install
|
||||||
|
|
||||||
- BetterRTP JAR: `dist/BetterRTP-3.6.13.jar`
|
The file will be in the Target file.
|
||||||
- Addons JAR: `dist/BetterRTPAddons-1.8.10.jar`
|
|
||||||
|
|
||||||
Both server-ready JARs are collected in `dist/`. `mvn clean` removes each selected plugin’s previous JARs from this folder; intermediate build files stay in `target/`. The `dev` profile still outputs directly to its configured server plugins folder.
|
|
||||||
|
|
||||||
The root `pom.xml` aggregates both modules. Core plugin dependencies and build settings live in `BetterRTP-Core/pom.xml`; its sources live in `BetterRTP-Core/src/`. To build only the core plugin, use `mvn -pl :BetterRTP clean package`. Existing `-Deditor.website=...`, `-Deditor.buildSuffix=...`, and `-Pdev` options remain available.
|
|
||||||
|
|
||||||
## Where's the Wiki?
|
## Where's the Wiki?
|
||||||
The wiki is available [here](../../wiki)!
|
The wiki is available [here](../../wiki)!
|
||||||
@@ -52,56 +33,3 @@ The wiki is available [here](../../wiki)!
|
|||||||
<br/>
|
<br/>
|
||||||
<b><i><a href="https://www.spigotmc.org/resources/authors/superronancraft.13025/">Check out my other plugins!</a></i></b>
|
<b><i><a href="https://www.spigotmc.org/resources/authors/superronancraft.13025/">Check out my other plugins!</a></i></b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Shared editor library
|
|
||||||
|
|
||||||
The web editor uses [BetterSync](https://github.com/RonanPlugins/BetterSync),
|
|
||||||
downloaded by Maven from JitPack as `com.github.RonanPlugins:BetterSync:2.0.0`.
|
|
||||||
No local BetterSync project or manual Maven install is required. Release `2.0.0` is published on JitPack. Update `bettersync.version` in the plugin and editor-test
|
|
||||||
POMs together when upgrading. Shade bundles and relocates the library into the
|
|
||||||
plugin JAR; server owners do not install a separate BetterSync plugin.
|
|
||||||
|
|
||||||
The plugin retains its scheduler, permissions, reload callbacks, and filtered
|
|
||||||
`editor.website` setting. Editor transport and configuration validation are
|
|
||||||
maintained in BetterSync.
|
|
||||||
|
|
||||||
### Editor schema ownership
|
|
||||||
|
|
||||||
Each plugin module owns `src/main/resources/META-INF/editor-schema.json` and packages
|
|
||||||
it in its JAR. It describes field types, lists, defaults and form collection hints.
|
|
||||||
BetterSync checks basic types and required sections; it does not enforce business
|
|
||||||
rules such as ranges, material names or relationships between fields.
|
|
||||||
|
|
||||||
When a stable GitHub release is published, `.github/workflows/publish-editor-schema.yml`
|
|
||||||
attaches the schema from that exact release tag to this repository's release. BetterRTP
|
|
||||||
publishes both Core and Addons schemas. The workflow uses the built-in GitHub token;
|
|
||||||
no cross-repository publishing secret is needed. Release tags must include the workflow
|
|
||||||
and the schema resource. Do not replace a published schema; increment `schemaVersion`
|
|
||||||
when changing field metadata.
|
|
||||||
|
|
||||||
Website builds discover this repository's latest stable release and download its schema.
|
|
||||||
No plugin checkout or local Maven install is needed. The website uses a build-only token
|
|
||||||
with Contents read access for private repositories. It must be rebuilt after the schema
|
|
||||||
publication workflow succeeds. An unsupported plugin schema version is rejected until
|
|
||||||
the corresponding website build is deployed.
|
|
||||||
|
|
||||||
Use the website's schema-version database migrations before deploying these clients.
|
|
||||||
|
|
||||||
### Automatic Maven releases
|
|
||||||
|
|
||||||
`.github/workflows/release.yml` runs on pushes to `online-editor` (or manually from
|
|
||||||
that branch). It reads only the Core POM version, builds and verifies BetterRTP Core,
|
|
||||||
runs the editor tests, and publishes a stable GitHub release with exactly one plugin
|
|
||||||
JAR. For the current Core POM the title is `BetterRTP 3.6.13` and the tag is `v3.6.13`.
|
|
||||||
This single-JAR release is compatible with the website's GitHub release importer.
|
|
||||||
|
|
||||||
Both Core and Addons editor-schema JSON files remain attached for the website editor.
|
|
||||||
Copying Addons metadata does not compile or publish its plugin binary. GitHub's Maven
|
|
||||||
test workflow also selects Core only. Build and upload the Addons plugin manually;
|
|
||||||
do not attach its JAR to the automated BetterRTP release, which must contain one JAR.
|
|
||||||
Local root Maven builds still build both modules.
|
|
||||||
|
|
||||||
An existing release is left untouched. Bump `BetterRTP-Core/pom.xml` to publish the next
|
|
||||||
Core release. An Addons-only version bump does not create a new Core release.
|
|
||||||
SNAPSHOT versions are rejected. GitHub's built-in token needs Contents write
|
|
||||||
permission, which the workflow declares. No extra publishing token is required.
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,18 +1,385 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP-build</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
<version>3.6.13</version>
|
<version>3.6.13</version>
|
||||||
<packaging>pom</packaging>
|
|
||||||
<modules>
|
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
||||||
<module>BetterRTP-Core</module>
|
|
||||||
<module>BetterRTPAddons</module>
|
<properties>
|
||||||
</modules>
|
<maven.compiler.release>8</maven.compiler.release>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</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.2.2</version>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>../../Java/plugins</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<!-- The core plugin owns the root target directory. -->
|
<resources>
|
||||||
<directory>${project.basedir}/target/reactor</directory>
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<!-- Shade PaperLib into project -->
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.5.0</version>
|
||||||
|
<configuration>
|
||||||
|
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
|
||||||
|
</dependencyReducedPomLocation>
|
||||||
|
<relocations>
|
||||||
|
<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>
|
||||||
|
<!--relocation>
|
||||||
|
<pattern>xyz.xenondevs.particle</pattern>
|
||||||
|
<shadedPattern>me.SuperRonanCraft.BetterRTP.particleLib</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.10.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
</build>
|
</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>
|
||||||
|
<!-- 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://papermc.io/repo/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>
|
||||||
|
<!-- FoliaLib https://github.com/TechnicallyCoded/FoliaLib -->
|
||||||
|
<repository>
|
||||||
|
<id>devmart-other</id>
|
||||||
|
<url>https://nexuslite.gcnt.net/repos/other/</url>
|
||||||
|
</repository>
|
||||||
|
<!-- Used by FactionsBridge -->
|
||||||
|
<repository>
|
||||||
|
<id>devmart-public</id>
|
||||||
|
<url>https://nexuslite.gcnt.net/repos/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<dependencies>
|
||||||
|
<!--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>4.8.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>16.18</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- KingdomsX v1.10.5.2 (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.26</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- EssentialsX -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.essentialsx</groupId>
|
||||||
|
<artifactId>EssentialsX</artifactId>
|
||||||
|
<version>2.20.1</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.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Husktown (https://www.spigotmc.org/resources/husktowns.92672/) (Added in 3.4.5)-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.william278</groupId>
|
||||||
|
<artifactId>HuskTowns</artifactId>
|
||||||
|
<version>2.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.3.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- FactionsBridge -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dansplugins.factionsystem</groupId>
|
||||||
|
<artifactId>FactionsBridge</artifactId>
|
||||||
|
<version>1.3.8</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.WhipDevelopment</groupId>
|
||||||
|
<artifactId>CrashClaim</artifactId>
|
||||||
|
<version>-75abe3b665-1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- CAN BE UNCOMMENTED IF YOU HAVE ACCESS TO THE PLUGIN -->
|
||||||
|
<!-- Private Repoed -->
|
||||||
|
<!-- This is uploaded to our private repo on https://repo.ronanplugins.com -->
|
||||||
|
<!-- hClaims (https://www.spigotmc.org/resources/90540/) -->
|
||||||
|
<!--<dependency>
|
||||||
|
<groupId>com.ronanplugins</groupId>
|
||||||
|
<artifactId>hClaims</artifactId>
|
||||||
|
<version>2.5.3</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>-->
|
||||||
|
<!-- Provided by repo: devmart-public -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bekvon.bukkit.residence</groupId>
|
||||||
|
<artifactId>Residence</artifactId>
|
||||||
|
<version>5.1.4.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
-11
@@ -1,8 +1,5 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP;
|
package me.SuperRonanCraft.BetterRTP;
|
||||||
|
|
||||||
import com.ronanplugins.bettersync.editor.EditorClient;
|
|
||||||
import com.ronanplugins.bettersync.editor.EditorSchema;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.PlayerInfo;
|
import me.SuperRonanCraft.BetterRTP.player.PlayerInfo;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.commands.Commands;
|
import me.SuperRonanCraft.BetterRTP.player.commands.Commands;
|
||||||
@@ -50,19 +47,12 @@ public class BetterRTP extends JavaPlugin {
|
|||||||
@Getter private boolean PlaceholderAPI;
|
@Getter private boolean PlaceholderAPI;
|
||||||
@Getter private final RTPLogger rtpLogger = new RTPLogger();
|
@Getter private final RTPLogger rtpLogger = new RTPLogger();
|
||||||
@Getter private final FoliaHandler foliaHandler = new FoliaHandler();
|
@Getter private final FoliaHandler foliaHandler = new FoliaHandler();
|
||||||
@Getter private EditorClient editorBridge;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
registerDependencies();
|
registerDependencies();
|
||||||
loadAll();
|
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 Updater(this);
|
||||||
new Metrics(this);
|
new Metrics(this);
|
||||||
listener.registerEvents(this);
|
listener.registerEvents(this);
|
||||||
@@ -76,7 +66,6 @@ public class BetterRTP extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (editorBridge != null) editorBridge.close();
|
|
||||||
invs.closeAll();
|
invs.closeAll();
|
||||||
queue.unload();
|
queue.unload();
|
||||||
rtpLogger.unload();
|
rtpLogger.unload();
|
||||||
File renamed without changes.
+1
-4
@@ -43,10 +43,7 @@ public class Commands {
|
|||||||
//Command Event
|
//Command Event
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
boolean editorSync = args[0].equalsIgnoreCase("editorsync") ||
|
BetterRTP.debug(sendi.getName() + " executed: /" + label + " " + String.join(" ", args));
|
||||||
(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);
|
cmd.execute(sendi, label, args);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(new RTP_CommandEvent_After(sendi, cmd));
|
Bukkit.getServer().getPluginManager().callEvent(new RTP_CommandEvent_After(sendi, cmd));
|
||||||
}
|
}
|
||||||
File renamed without changes.
File renamed without changes.
-2
@@ -5,8 +5,6 @@ import me.SuperRonanCraft.BetterRTP.player.commands.types.*;
|
|||||||
public enum RTPCommandType {
|
public enum RTPCommandType {
|
||||||
BIOME(new CmdBiome()),
|
BIOME(new CmdBiome()),
|
||||||
EDIT(new CmdEdit()),
|
EDIT(new CmdEdit()),
|
||||||
EDITOR(new CmdEditor()),
|
|
||||||
EDITOR_SYNC(new CmdEditorSync()),
|
|
||||||
HELP(new CmdHelp()),
|
HELP(new CmdHelp()),
|
||||||
INFO(new CmdInfo()),
|
INFO(new CmdInfo()),
|
||||||
LOCATION(new CmdLocation()),
|
LOCATION(new CmdLocation()),
|
||||||
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.
+4
-2
@@ -20,7 +20,9 @@ public class Join {
|
|||||||
static void event(PlayerJoinEvent e) {
|
static void event(PlayerJoinEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
updater(p);
|
updater(p);
|
||||||
AsyncHandler.async(() -> getPl().getCooldowns().loadPlayer(p));
|
AsyncHandler.async(() -> {
|
||||||
|
getPl().getCooldowns().loadPlayer(p);
|
||||||
|
});
|
||||||
rtpOnFirstJoin(p);
|
rtpOnFirstJoin(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ public class Join {
|
|||||||
//RTP on first join
|
//RTP on first join
|
||||||
private static void rtpOnFirstJoin(Player p) {
|
private static void rtpOnFirstJoin(Player p) {
|
||||||
if (getPl().getSettings().isRtpOnFirstJoin_Enabled() && !p.hasPlayedBefore())
|
if (getPl().getSettings().isRtpOnFirstJoin_Enabled() && !p.hasPlayedBefore())
|
||||||
HelperRTP.tp(p, Bukkit.getConsoleSender(), Bukkit.getWorld(getPl().getSettings().getRtpOnFirstJoin_World()), null, RTP_TYPE.JOIN, true, true);
|
HelperRTP.tp(p, Bukkit.getConsoleSender(), Bukkit.getWorld(getPl().getSettings().getRtpOnFirstJoin_World()), null, RTP_TYPE.JOIN); //Console is sender to override delays
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BetterRTP getPl() {
|
private static BetterRTP getPl() {
|
||||||
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.
+11
-3
@@ -6,6 +6,8 @@ import com.comphenix.protocol.events.PacketContainer;
|
|||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
public abstract class AbstractPacket {
|
public abstract class AbstractPacket {
|
||||||
// The packet we will be modifying
|
// The packet we will be modifying
|
||||||
protected PacketContainer handle;
|
protected PacketContainer handle;
|
||||||
@@ -40,9 +42,15 @@ public abstract class AbstractPacket {
|
|||||||
* Send the current packet to the given receiver.
|
* Send the current packet to the given receiver.
|
||||||
*
|
*
|
||||||
* @param receiver - the receiver.
|
* @param receiver - the receiver.
|
||||||
|
* @throws RuntimeException If the packet cannot be sent.
|
||||||
*/
|
*/
|
||||||
public void sendPacket(Player receiver) {
|
public void sendPacket(Player receiver) {
|
||||||
ProtocolLibrary.getProtocolManager().sendServerPacket(receiver, getHandle());
|
try {
|
||||||
|
ProtocolLibrary.getProtocolManager().sendServerPacket(receiver,
|
||||||
|
getHandle());
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
throw new RuntimeException("Cannot send packet.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +71,7 @@ public abstract class AbstractPacket {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public void recievePacket(Player sender) {
|
public void recievePacket(Player sender) {
|
||||||
try {
|
try {
|
||||||
ProtocolLibrary.getProtocolManager().receiveClientPacket(sender,
|
ProtocolLibrary.getProtocolManager().recieveClientPacket(sender,
|
||||||
getHandle());
|
getHandle());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Cannot recieve packet.", e);
|
throw new RuntimeException("Cannot recieve packet.", e);
|
||||||
@@ -78,7 +86,7 @@ public abstract class AbstractPacket {
|
|||||||
*/
|
*/
|
||||||
public void receivePacket(Player sender) {
|
public void receivePacket(Player sender) {
|
||||||
try {
|
try {
|
||||||
ProtocolLibrary.getProtocolManager().receiveClientPacket(sender,
|
ProtocolLibrary.getProtocolManager().recieveClientPacket(sender,
|
||||||
getHandle());
|
getHandle());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Cannot receive packet.", e);
|
throw new RuntimeException("Cannot receive packet.", e);
|
||||||
File renamed without changes.
+2
-3
@@ -49,10 +49,9 @@ public interface PermissionCheck {
|
|||||||
|
|
||||||
String getNode();
|
String getNode();
|
||||||
|
|
||||||
@Getter
|
|
||||||
class PermissionResult {
|
class PermissionResult {
|
||||||
private final boolean passed;
|
@Getter private final boolean passed;
|
||||||
private final String string;
|
@Getter private final String string;
|
||||||
PermissionResult(String string, boolean passed) {
|
PermissionResult(String string, boolean passed) {
|
||||||
this.passed = passed;
|
this.passed = passed;
|
||||||
this.string = string;
|
this.string = string;
|
||||||
+1
-3
@@ -2,7 +2,6 @@ package me.SuperRonanCraft.BetterRTP.references;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
|
||||||
public enum PermissionNode implements PermissionCheck {
|
public enum PermissionNode implements PermissionCheck {
|
||||||
|
|
||||||
ADMIN("admin"),
|
ADMIN("admin"),
|
||||||
@@ -22,12 +21,11 @@ public enum PermissionNode implements PermissionCheck {
|
|||||||
SIGN_CREATE("sign"),
|
SIGN_CREATE("sign"),
|
||||||
VERSION("version"),
|
VERSION("version"),
|
||||||
EDIT("edit"),
|
EDIT("edit"),
|
||||||
EDITOR("editor"),
|
|
||||||
LOCATION("location"),
|
LOCATION("location"),
|
||||||
DEVELOPER("DEVELOPER_PERM"),
|
DEVELOPER("DEVELOPER_PERM"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String node;
|
@Getter private final String node;
|
||||||
|
|
||||||
PermissionNode(String node) {
|
PermissionNode(String node) {
|
||||||
this.node = PermissionCheck.getPrefix() + node;
|
this.node = PermissionCheck.getPrefix() + node;
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package me.SuperRonanCraft.BetterRTP.references;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.depends.DepPerms;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
public class Permissions {
|
||||||
|
|
||||||
|
private final DepPerms depPerms = new DepPerms();
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
depPerms.register();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkPerm(String str, CommandSender sendi) {
|
||||||
|
return depPerms.hasPerm(str, sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//Moved to PermissionNode.NODE
|
||||||
|
/*private final String pre = "betterrtp.";
|
||||||
|
|
||||||
|
public boolean getUse(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "use", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBypassEconomy(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "bypass.economy", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBypassHunger(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "bypass.hunger", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBypassCooldown(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "bypass.cooldown", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBypassDelay(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "bypass.delay", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getReload(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "reload", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getSettings(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "settings", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getInfo(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "info", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getUpdate(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "updater", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getRtpOther(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "player", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBiome(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "biome", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getWorld(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "world", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getSignCreate(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "sign", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getTest(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "test", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getVersion(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "version", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getAWorld(CommandSender sendi, String world) {
|
||||||
|
if (checkPerm(pre + "world.*", sendi))
|
||||||
|
return true;
|
||||||
|
else if (world == null) {
|
||||||
|
for (World w : Bukkit.getWorlds())
|
||||||
|
if (checkPerm(pre + "world." + w.getName(), sendi))
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return checkPerm(pre + "world." + world, sendi);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getEdit(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "edit", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getLocation(CommandSender sendi) {
|
||||||
|
return checkPerm(pre + "location", sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getLocation(CommandSender sendi, String location) {
|
||||||
|
return checkPerm(pre + "location." + location, sendi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getPermissionGroup(CommandSender sendi, String group) {
|
||||||
|
return checkPerm(pre + "group." + group, sendi);
|
||||||
|
}*/
|
||||||
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.
@@ -0,0 +1,84 @@
|
|||||||
|
package me.SuperRonanCraft.BetterRTP.references.database;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.player.playerdata.PlayerData;
|
||||||
|
|
||||||
|
public class DatabasePlayers extends SQLite {
|
||||||
|
|
||||||
|
public DatabasePlayers() {
|
||||||
|
super(DATABASE_TYPE.PLAYERS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getTables() {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add("Players");
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum COLUMNS {
|
||||||
|
UUID("uuid", "varchar(32) PRIMARY KEY"),
|
||||||
|
//COOLDOWN DATA
|
||||||
|
COUNT("count", "long"),
|
||||||
|
LAST_COOLDOWN_DATE("last_rtp_date", "long"),
|
||||||
|
//USES("uses", "integer"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final String type;
|
||||||
|
|
||||||
|
COLUMNS(String name, String type) {
|
||||||
|
this.name = name;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setupData(PlayerData data) {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
try {
|
||||||
|
conn = getSQLConnection();
|
||||||
|
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0) + " WHERE " + COLUMNS.UUID.name + " = ?");
|
||||||
|
ps.setString(1, data.player.getUniqueId().toString());
|
||||||
|
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
if (rs.next()) {
|
||||||
|
long count = rs.getLong(COLUMNS.COUNT.name);
|
||||||
|
long time = rs.getLong(COLUMNS.LAST_COOLDOWN_DATE.name);
|
||||||
|
data.setRtpCount(Math.toIntExact(count));
|
||||||
|
data.setGlobalCooldown(time);
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||||
|
} finally {
|
||||||
|
close(ps, rs, conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Set a player Cooldown
|
||||||
|
public void setData(PlayerData data) {
|
||||||
|
String pre = "INSERT OR REPLACE INTO ";
|
||||||
|
String sql = pre + tables.get(0) + " ("
|
||||||
|
+ COLUMNS.UUID.name + ", "
|
||||||
|
+ COLUMNS.COUNT.name + ", "
|
||||||
|
+ COLUMNS.LAST_COOLDOWN_DATE.name + " "
|
||||||
|
//+ COLUMNS.USES.name + " "
|
||||||
|
+ ") VALUES(?, ?, ?)";
|
||||||
|
List<Object> params = new ArrayList<Object>() {{
|
||||||
|
add(data.player.getUniqueId().toString());
|
||||||
|
add(data.getRtpCount());
|
||||||
|
add(data.getGlobalCooldown());
|
||||||
|
//add(data.getUses());
|
||||||
|
}};
|
||||||
|
sqlUpdate(sql, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,226 @@
|
|||||||
|
package me.SuperRonanCraft.BetterRTP.references.database;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueData;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueGenerator;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.QueueHandler;
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.rtpinfo.worlds.RTPWorld;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
public class DatabaseQueue extends SQLite {
|
||||||
|
|
||||||
|
public DatabaseQueue() {
|
||||||
|
super(DATABASE_TYPE.QUEUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getTables() {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add("Queue");
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum COLUMNS {
|
||||||
|
ID("id", "integer PRIMARY KEY AUTOINCREMENT"),
|
||||||
|
//Location Data
|
||||||
|
X("x", "long"),
|
||||||
|
Z("z", "long"),
|
||||||
|
WORLD("world", "varchar(32)"),
|
||||||
|
GENERATED("generated", "long")
|
||||||
|
;
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final String type;
|
||||||
|
|
||||||
|
COLUMNS(String name, String type) {
|
||||||
|
this.name = name;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public List<QueueData> getAll() {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
List<QueueData> queueDataList = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
conn = getSQLConnection();
|
||||||
|
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0));
|
||||||
|
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
long x = rs.getLong(COLUMNS.X.name);
|
||||||
|
long z = rs.getLong(COLUMNS.Z.name);
|
||||||
|
String worldName = rs.getString(COLUMNS.WORLD.name);
|
||||||
|
int id = rs.getInt(COLUMNS.ID.name);
|
||||||
|
long generated = rs.getLong(COLUMNS.GENERATED.name);
|
||||||
|
World world = Bukkit.getWorld(worldName);
|
||||||
|
if (world != null) {
|
||||||
|
queueDataList.add(new QueueData(new Location(world, x, 69, z), generated, id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||||
|
} finally {
|
||||||
|
close(ps, rs, conn);
|
||||||
|
}
|
||||||
|
return queueDataList;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Override public void load() {
|
||||||
|
if (QueueHandler.isEnabled())
|
||||||
|
super.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<QueueData> getInRange(QueueRangeData range) {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
List<QueueData> queueDataList = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
conn = getSQLConnection();
|
||||||
|
//ps = conn.prepareStatement("SELECT * FROM " + tables.get(0) + " WHERE ? BETWEEN ? AND ? AND ? BETWEEN ? AND ?");
|
||||||
|
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0) + " WHERE "
|
||||||
|
+ COLUMNS.WORLD.name + " = '" + range.getWorld().getName() + "' AND "
|
||||||
|
+ COLUMNS.X.name + " BETWEEN " + range.getXLow() + " AND " + range.getXHigh()
|
||||||
|
+ " AND " + COLUMNS.Z.name + " BETWEEN " + range.getZLow() + " AND " + range.getZHigh()
|
||||||
|
+ " ORDER BY RANDOM() LIMIT " + (QueueGenerator.queueMax + 1)
|
||||||
|
);
|
||||||
|
/*ps.setString(1, COLUMNS.X.name);
|
||||||
|
ps.setInt(2, range.getXLow());
|
||||||
|
ps.setInt(3, range.getXHigh());
|
||||||
|
ps.setString(4, COLUMNS.Z.name);
|
||||||
|
ps.setInt(5, range.getZLow());
|
||||||
|
ps.setInt(6, range.getZHigh());*/
|
||||||
|
|
||||||
|
//BetterRTP.getInstance().getLogger().info(ps.toString());
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
long x = rs.getLong(COLUMNS.X.name);
|
||||||
|
long z = rs.getLong(COLUMNS.Z.name);
|
||||||
|
String worldName = rs.getString(COLUMNS.WORLD.name);
|
||||||
|
int id = rs.getInt(COLUMNS.ID.name);
|
||||||
|
long generated = rs.getLong(COLUMNS.GENERATED.name);
|
||||||
|
World world = Bukkit.getWorld(worldName);
|
||||||
|
if (world != null) {
|
||||||
|
queueDataList.add(new QueueData(new Location(world, x, 69 /*giggity*/, z), generated, id));
|
||||||
|
//queueDataList.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||||
|
} finally {
|
||||||
|
close(ps, rs, conn);
|
||||||
|
}
|
||||||
|
return queueDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Set a queue to save
|
||||||
|
public QueueData addQueue(Location loc) {
|
||||||
|
String pre = "INSERT INTO ";
|
||||||
|
String sql = pre + tables.get(0) + " ("
|
||||||
|
+ COLUMNS.X.name + ", "
|
||||||
|
+ COLUMNS.Z.name + ", "
|
||||||
|
+ COLUMNS.WORLD.name + ", "
|
||||||
|
+ COLUMNS.GENERATED.name + " "
|
||||||
|
//+ COLUMNS.USES.name + " "
|
||||||
|
+ ") VALUES(?, ?, ?, ?)";
|
||||||
|
List<Object> params = new ArrayList<Object>() {{
|
||||||
|
add(loc.getBlockX());
|
||||||
|
add(loc.getBlockZ());
|
||||||
|
add(loc.getWorld().getName());
|
||||||
|
add(System.currentTimeMillis());
|
||||||
|
//add(data.getUses());
|
||||||
|
}};
|
||||||
|
//return sqlUpdate(sql, params);
|
||||||
|
int database_id = createQueue(sql, params);
|
||||||
|
if (database_id >= 0)
|
||||||
|
return new QueueData(loc, System.currentTimeMillis(), database_id);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
int count = 0;
|
||||||
|
try {
|
||||||
|
conn = getSQLConnection();
|
||||||
|
ps = conn.prepareStatement("SELECT * FROM " + tables.get(0));
|
||||||
|
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
count = rs.getFetchSize();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||||
|
} finally {
|
||||||
|
close(ps, rs, conn);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int createQueue(String statement, @NonNull List<Object> params) {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
int id = -1;
|
||||||
|
try {
|
||||||
|
conn = getSQLConnection();
|
||||||
|
ps = conn.prepareStatement(statement, Statement.RETURN_GENERATED_KEYS);
|
||||||
|
Iterator<Object> it = params.iterator();
|
||||||
|
int paramIndex = 1;
|
||||||
|
while (it.hasNext()) {
|
||||||
|
ps.setObject(paramIndex, it.next());
|
||||||
|
paramIndex++;
|
||||||
|
}
|
||||||
|
ps.executeUpdate();
|
||||||
|
ResultSet rs = ps.getGeneratedKeys();
|
||||||
|
if (rs.next()) {
|
||||||
|
id = rs.getInt(1);
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
BetterRTP.getInstance().getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
|
||||||
|
} finally {
|
||||||
|
close(ps, null, conn);
|
||||||
|
}
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean removeLocation(Location loc) {
|
||||||
|
String sql = "DELETE FROM " + tables.get(0) + " WHERE "
|
||||||
|
+ COLUMNS.X.name + " = ? AND "
|
||||||
|
+ COLUMNS.Z.name + " = ? AND "
|
||||||
|
+ COLUMNS.WORLD.name + " = ?"
|
||||||
|
;
|
||||||
|
List<Object> params = new ArrayList<Object>() {{
|
||||||
|
add(loc.getBlockX());
|
||||||
|
add(loc.getBlockZ());
|
||||||
|
add(loc.getWorld().getName());
|
||||||
|
}};
|
||||||
|
return sqlUpdate(sql, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class QueueRangeData {
|
||||||
|
|
||||||
|
@Getter int xLow, xHigh;
|
||||||
|
@Getter int zLow, zHigh;
|
||||||
|
@Getter World world;
|
||||||
|
|
||||||
|
public QueueRangeData(RTPWorld rtpWorld) {
|
||||||
|
this.xLow = rtpWorld.getCenterX() - rtpWorld.getMaxRadius();
|
||||||
|
this.xHigh = rtpWorld.getCenterX() + rtpWorld.getMaxRadius();
|
||||||
|
this.zLow = rtpWorld.getCenterZ() - rtpWorld.getMaxRadius();
|
||||||
|
this.zHigh = rtpWorld.getCenterZ() + rtpWorld.getMaxRadius();
|
||||||
|
this.world = rtpWorld.getWorld();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 231 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user