mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-04 16:56:40 +00:00
Compare commits
77 Commits
Author | SHA1 | Date | |
---|---|---|---|
ecbd9c02da | |||
77dc95ae29 | |||
91a1b1cfff | |||
0c6091f06a | |||
ffbad7928a | |||
7caa89539d | |||
ceb9a83eda | |||
a62bdef5b4 | |||
37649f1fdc | |||
ea512487ac | |||
41b0076f8f | |||
00b6473e4d | |||
77be23faf0 | |||
e39f882ea7 | |||
344d890877 | |||
2c8c6353c1 | |||
8fa05e3838 | |||
158ce52320 | |||
1cc431621b | |||
b9c873beb3 | |||
6e1fa15a6c | |||
c216bdc5a4 | |||
ed638679b2 | |||
76952e33b8 | |||
f3f7daaafb | |||
dbbaf4ab70 | |||
1a10fdd481 | |||
7565bb6fcf | |||
22199be335 | |||
2e077c40d2 | |||
517b829420 | |||
7fa26f9a64 | |||
09846f1d33 | |||
ed70a0ec8b | |||
16e29b80a7 | |||
829bb88959 | |||
d6b44863aa | |||
f806470fd5 | |||
3611148b4c | |||
262af44193 | |||
a014a38e2f | |||
d896179f47 | |||
9dac0e799e | |||
5c27fb00e7 | |||
679d8bcbc0 | |||
46de6dba84 | |||
d2649508b3 | |||
dd8e22b676 | |||
b26e489e83 | |||
5f64e02cae | |||
4a14f94158 | |||
6763e12d81 | |||
1d0fb85fa1 | |||
665a2f4e72 | |||
9c67911c1b | |||
f1ebbc3664 | |||
4aa3ae7c50 | |||
08e2f31eae | |||
a1c009909d | |||
7d2c44975d | |||
b2faec70a9 | |||
a0cca2aea5 | |||
337334d403 | |||
2e8fe8767e | |||
dbdf720a9e | |||
5a9d6dd60d | |||
84a9535123 | |||
41aff575d0 | |||
65b8188b37 | |||
c8a35c8e0e | |||
13acf7ba9d | |||
5fe48cfd7f | |||
abf2aca0f2 | |||
dc4ac39fe4 | |||
1ae8e779b1 | |||
658f4a4b05 | |||
7ccfb2ad27 |
40
.github/workflows/codeql-analysis.yml
vendored
40
.github/workflows/codeql-analysis.yml
vendored
@ -1,14 +1,3 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
@ -18,7 +7,7 @@ on:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '29 4 * * *'
|
||||
- cron: '30 4 * * *'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@ -33,45 +22,26 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'java' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
java: [ 17 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
- name: Set up JDK ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: gradle
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
- run: |
|
||||
chmod +x gradlew
|
||||
./gradlew build --no-daemon
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
32
.github/workflows/gradle.yml
vendored
32
.github/workflows/gradle.yml
vendored
@ -1,18 +1,26 @@
|
||||
name: Gradle
|
||||
|
||||
on: [ push ]
|
||||
# Adapted from Paper's build script
|
||||
name: Build
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Only run on PRs if the source branch is on someone else's repo
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ 17 ]
|
||||
fail-fast: true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: JDK ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
cache: gradle
|
||||
- name: Build with Gradle
|
||||
run: chmod a+x gradlew && ./gradlew build --no-daemon
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: 'gradle'
|
||||
distribution: 'temurin'
|
||||
- name: Build
|
||||
run: |
|
||||
git config --global user.email "no-reply@github.com"
|
||||
git config --global user.name "Github Actions"
|
||||
./gradlew build --stacktrace
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -15,3 +15,6 @@ Thumbs.db
|
||||
/build/
|
||||
/*/build/
|
||||
/.gradle/
|
||||
|
||||
# Common working directory
|
||||
run/
|
35
.idea/codeStyles/Plexus_Code_Style.xml
generated
35
.idea/codeStyles/Plexus_Code_Style.xml
generated
@ -1,33 +1,8 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Plexus Code Style" version="1">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="20" />
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JetCodeStyleSettings>
|
||||
<code_scheme name="Plexus Code Style" version="173">
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
<option name="BRACE_STYLE" value="2" />
|
||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||
<option name="METHOD_BRACE_STYLE" value="2" />
|
||||
@ -36,14 +11,10 @@
|
||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
<option name="WHILE_BRACE_FORCE" value="3" />
|
||||
<option name="FOR_BRACE_FORCE" value="3" />
|
||||
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="0" />
|
||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
||||
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@ -1,5 +1,5 @@
|
||||
For those who are wanting to contribute, we fully encourage doing so. There are a few rules we require following when
|
||||
contributing however.
|
||||
contributing.
|
||||
|
||||
## Steps
|
||||
|
||||
@ -17,7 +17,8 @@ contributing however.
|
||||
- Keep in mind that it **must** be formatted correctly. If you are using IntelliJ, there is a `codeStyle.xml` file that
|
||||
tells IntelliJ how to format your code. Check this link for information on how to use the
|
||||
file: https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes
|
||||
- If you are not using IntelliJ, that is fine. We use Allman style so please format your code accordingly.
|
||||
- If you are not using IntelliJ, that is fine. We use the Plexus Code Style (which is almost the same as Allman) so
|
||||
please format your code accordingly.
|
||||
|
||||
6. Push your changes to your new branch and make a PR based off of that branch.
|
||||
|
||||
|
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@ -8,23 +8,11 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("publish") {
|
||||
when {
|
||||
branch "master"
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: '85b7099f-2e65-461e-b2ce-124edec41ed6', passwordVariable: 'plexPassword', usernameVariable: 'plexUser')]) {
|
||||
withGradle {
|
||||
sh "./gradlew publish --no-daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: "build/libs/*.jar", fingerprint: true
|
||||
javadoc javadocDir: "api/build/docs/javadoc", keepAll: false
|
||||
javadoc javadocDir: "server/build/docs/javadoc", keepAll: false
|
||||
discordSend description: "**Build:** ${env.BUILD_NUMBER}\n**Status:** ${currentBuild.currentResult}", enableArtifactsList: true, footer: "Built with Jenkins", link: env.BUILD_URL, result: currentBuild.currentResult, scmWebUrl: "https://github.com/plexusorg/Plex", showChangeset: true, title: env.JOB_NAME, webhookURL: env.WEBHOOK_URL
|
||||
cleanWs()
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Plex [](https://ci.plex.us.org/job/Plex/job/master/)
|
||||
# Plex [](https://ci.plex.us.org/job/Plex/job/master/) [](https://github.com/plexusorg/Plex/blob/master/LICENSE.md) [](https://discord.plex.us.org)
|
||||
|
||||
Plex is a new freedom plugin. It is an alternative to TotalFreedomMod. It has many of the features that make a freedom
|
||||
server unique, but also many features that TotalFreedomMod doesn’t have. For example, there is full support for using a
|
||||
|
@ -1,32 +0,0 @@
|
||||
group = rootProject.group
|
||||
version = rootProject.version
|
||||
description = "Plex-API"
|
||||
|
||||
jar {
|
||||
archiveBaseName.set("Plex-API")
|
||||
}
|
||||
|
||||
tasks {
|
||||
jar {
|
||||
finalizedBy(rootProject.tasks.copyJars)
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "org.projectlombok:lombok:1.18.24"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.24"
|
||||
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
|
||||
compileOnly "org.json:json:20220320"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package dev.plex.api;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IPlayerCache<T>
|
||||
{
|
||||
Map<UUID, T> getPlexPlayerMap();
|
||||
|
||||
T getPlexPlayer(UUID uuid);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package dev.plex.api;
|
||||
|
||||
public interface PlexApi
|
||||
{
|
||||
IPlayerCache<?> getPlayerCache();
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
package dev.plex.api;
|
||||
|
||||
public interface PlexApiProvider
|
||||
{
|
||||
PlexApi getApi();
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package dev.plex.api.chat;
|
||||
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
|
||||
public interface IChatHandler
|
||||
{
|
||||
void doChat(AsyncChatEvent event);
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package dev.plex.api.permission;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface IPermissionHandler
|
||||
{
|
||||
default boolean hasPermission(@NotNull Player player, @Nullable String permission)
|
||||
{
|
||||
if (permission == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return player.hasPermission(permission);
|
||||
}
|
||||
|
||||
default boolean hasPermission(@NotNull OfflinePlayer player, @Nullable String permission)
|
||||
{
|
||||
if (permission == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (player.isOnline() && Bukkit.getPlayer(player.getUniqueId()) != null)
|
||||
{
|
||||
return Bukkit.getPlayer(player.getUniqueId()).hasPermission(permission);
|
||||
}
|
||||
throw new UnsupportedOperationException("Not implemented yet");
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package dev.plex.api.player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
|
||||
public interface IPlexPlayer
|
||||
{
|
||||
String getId();
|
||||
|
||||
UUID getUuid();
|
||||
|
||||
String getName();
|
||||
|
||||
Player getPlayer();
|
||||
|
||||
void setPlayer(Player player);
|
||||
|
||||
String getLoginMessage();
|
||||
|
||||
void setLoginMessage(String message);
|
||||
|
||||
String getPrefix();
|
||||
|
||||
void setPrefix(String prefix);
|
||||
|
||||
boolean isVanished();
|
||||
|
||||
void setVanished(boolean vanished);
|
||||
|
||||
boolean isCommandSpy();
|
||||
|
||||
void setCommandSpy(boolean commandSpy);
|
||||
|
||||
boolean isFrozen();
|
||||
|
||||
void setFrozen(boolean frozen);
|
||||
|
||||
boolean isMuted();
|
||||
|
||||
void setMuted(boolean muted);
|
||||
|
||||
boolean isLockedUp();
|
||||
|
||||
void setLockedUp(boolean lockedUp);
|
||||
|
||||
boolean isAdminActive();
|
||||
|
||||
void setAdminActive(boolean active);
|
||||
|
||||
long getCoins();
|
||||
|
||||
void setCoins(long coins);
|
||||
|
||||
String getRank();
|
||||
|
||||
void setRank(String rank);
|
||||
|
||||
List<String> getIps();
|
||||
|
||||
void setIps(List<String> ips);
|
||||
|
||||
PermissionAttachment getPermissionAttachment();
|
||||
|
||||
void setPermissionAttachment(PermissionAttachment attachment);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package dev.plex.api.plugin;
|
||||
|
||||
import dev.plex.api.chat.IChatHandler;
|
||||
import dev.plex.api.permission.IPermissionHandler;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public abstract class PlexPlugin extends JavaPlugin
|
||||
{
|
||||
@Setter(AccessLevel.NONE)
|
||||
private static PlexPlugin plugin;
|
||||
|
||||
private IChatHandler chatHandler;
|
||||
private IPermissionHandler permissionHandler;
|
||||
|
||||
@Override
|
||||
public void onLoad()
|
||||
{
|
||||
plugin = this;
|
||||
}
|
||||
|
||||
public static PlexPlugin get()
|
||||
{
|
||||
return plugin;
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package dev.plex.api.rank;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public interface IRank<T>
|
||||
{
|
||||
int getLevel();
|
||||
|
||||
String getLoginMessage();
|
||||
|
||||
void setLoginMessage(String message);
|
||||
|
||||
String getReadable();
|
||||
|
||||
Component getPrefix();
|
||||
|
||||
void setPrefix(String prefix);
|
||||
|
||||
NamedTextColor getColor();
|
||||
|
||||
boolean isAtLeast(T rank);
|
||||
|
||||
JSONObject toJSON();
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
plugins {
|
||||
id "java"
|
||||
id "maven-publish"
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
id "com.github.johnrengelman.shadow" version "8.1.1"
|
||||
}
|
||||
|
||||
group = "dev.plex"
|
||||
version = "1.1"
|
||||
version = "1.3"
|
||||
description = "Plex"
|
||||
|
||||
subprojects {
|
||||
@ -60,7 +60,6 @@ subprojects {
|
||||
}
|
||||
|
||||
clean {
|
||||
dependsOn(":api:clean")
|
||||
dependsOn(":server:clean")
|
||||
dependsOn(":proxy:clean")
|
||||
}
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
18
gradlew
vendored
18
gradlew
vendored
@ -55,7 +55,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@ -80,10 +80,10 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
@ -143,12 +143,16 @@ fi
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@ -205,6 +209,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
15
gradlew.bat
vendored
15
gradlew.bat
vendored
@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@ -25,7 +25,8 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("net.kyori.blossom") version "1.2.0"
|
||||
id("net.kyori.blossom") version "1.3.1"
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
@ -7,7 +7,7 @@ version = rootProject.version
|
||||
description = "Plex-Velocity"
|
||||
|
||||
repositories {
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||
}
|
||||
|
||||
tasks.getByName<Jar>("jar") {
|
||||
@ -37,10 +37,9 @@ publishing {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.projectlombok:lombok:1.18.24")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.24")
|
||||
compileOnly("org.json:json:20220320")
|
||||
compileOnly("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.1.2-SNAPSHOT")
|
||||
implementation(project(":api"))
|
||||
compileOnly("org.projectlombok:lombok:1.18.28")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.28")
|
||||
compileOnly("org.json:json:20230618")
|
||||
compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
|
||||
}
|
@ -10,10 +10,11 @@ import dev.plex.config.TomlConfig;
|
||||
import dev.plex.handlers.ListenerHandler;
|
||||
import dev.plex.settings.ServerSettings;
|
||||
import dev.plex.util.PlexLog;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.logging.Logger;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Credits for TOML library go to https://github.com/mwanji/toml4j
|
||||
|
@ -9,12 +9,13 @@ import dev.plex.Plex;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import java.util.Arrays;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public abstract class PlexCommand implements SimpleCommand
|
||||
{
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.plex.command.annotation;
|
||||
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
|
@ -3,12 +3,13 @@ package dev.plex.config;
|
||||
import dev.plex.Plex;
|
||||
import dev.plex.toml.Toml;
|
||||
import dev.plex.toml.TomlWriter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.function.Consumer;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public class TomlConfig
|
||||
|
@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
|
||||
import dev.plex.listener.PlexListener;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.ReflectionsUtil;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -7,13 +7,14 @@ import com.velocitypowered.api.proxy.server.ServerPing;
|
||||
import dev.plex.listener.PlexListener;
|
||||
import dev.plex.settings.ServerSettings;
|
||||
import dev.plex.util.RandomUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
public class ServerListener extends PlexListener
|
||||
{
|
||||
|
@ -2,10 +2,11 @@ package dev.plex.settings;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class ServerSettings
|
||||
{
|
||||
|
@ -4,6 +4,7 @@ package dev.plex.toml;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import static dev.plex.toml.ValueWriters.WRITERS;
|
||||
|
||||
public abstract class ArrayValueWriter implements dev.plex.toml.ValueWriter
|
||||
|
@ -1,14 +1,10 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
class ObjectValueWriter implements ValueWriter
|
||||
{
|
||||
|
@ -1,11 +1,6 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
class Results
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import static dev.plex.toml.ValueWriters.WRITERS;
|
||||
|
||||
class TableArrayValueWriter extends ArrayValueWriter
|
||||
|
@ -2,23 +2,12 @@ package dev.plex.toml;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>Provides access to the keys and tables in a TOML data source.</p>
|
||||
*
|
||||
|
@ -1,17 +1,13 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static dev.plex.toml.ValueWriters.WRITERS;
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static dev.plex.toml.ArrayValueReader.ARRAY_VALUE_READER;
|
||||
import static dev.plex.toml.BooleanValueReaderWriter.BOOLEAN_VALUE_READER_WRITER;
|
||||
import static dev.plex.toml.DateValueReaderWriter.DATE_VALUE_READER_WRITER;
|
||||
|
@ -1,8 +1,9 @@
|
||||
package dev.plex.util;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class RandomUtil
|
||||
{
|
||||
public static NamedTextColor getRandomColor()
|
||||
|
@ -3,6 +3,7 @@ package dev.plex.util;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.reflect.ClassPath;
|
||||
import dev.plex.Plex;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -6,26 +6,26 @@
|
||||
#############################
|
||||
|
||||
[server]
|
||||
name = "Plexus"
|
||||
name = "Plexus"
|
||||
|
||||
# Placeholders
|
||||
# %mcversion% - The Velocity Version (i.e. 3.1.2-SNAPSHOT)
|
||||
# %servername% - The name provided above
|
||||
# %randomgradient% - Creates a random gradient every ping of two random colors for the whole string
|
||||
# Supports MiniMessage strings, no legacy & and §
|
||||
motd = ["%randomgradient%%servername% - %mcversion%", "Another motd"]
|
||||
colorizeMotd = false
|
||||
# Placeholders
|
||||
# %mcversion% - The Velocity Version (i.e. 3.1.2-SNAPSHOT)
|
||||
# %servername% - The name provided above
|
||||
# %randomgradient% - Creates a random gradient every ping of two random colors for the whole string
|
||||
# Supports MiniMessage strings, no legacy & and §
|
||||
motd = ["%randomgradient%%servername% - %mcversion%", "Another motd"]
|
||||
colorizeMotd = false
|
||||
|
||||
# Enables debug messages
|
||||
debug = false
|
||||
# Enables debug messages
|
||||
debug = false
|
||||
|
||||
# Due to game code only supporting legacy color codes for
|
||||
# player samples and not components, you may only use § or & here
|
||||
# for colors.
|
||||
sample = ["example", "example"]
|
||||
# Due to game code only supporting legacy color codes for
|
||||
# player samples and not components, you may only use § or & here
|
||||
# for colors.
|
||||
sample = ["example", "example"]
|
||||
|
||||
# Adds this amount to the current player count
|
||||
add-player-count = 0
|
||||
# Adds this amount to the current player count
|
||||
add-player-count = 0
|
||||
|
||||
# The max player count will always display as +1 more than the player count
|
||||
plus-one-max-count = true
|
||||
# The max player count will always display as +1 more than the player count
|
||||
plus-one-max-count = true
|
@ -1,34 +1,23 @@
|
||||
plugins {
|
||||
id "net.minecrell.plugin-yml.bukkit" version "0.6.1-SNAPSHOT"
|
||||
id "net.minecrell.plugin-yml.paper" version "0.6.0"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
library "org.projectlombok:lombok:1.18.24"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.24"
|
||||
library "org.json:json:20220320"
|
||||
library "commons-io:commons-io:2.11.0"
|
||||
library "dev.morphia.morphia:morphia-core:2.2.6"
|
||||
library "redis.clients:jedis:4.2.2"
|
||||
library "org.mariadb.jdbc:mariadb-java-client:3.0.4"
|
||||
library "org.projectlombok:lombok:1.18.28"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.28"
|
||||
library "org.json:json:20230618"
|
||||
library "commons-io:commons-io:2.13.0"
|
||||
library "dev.morphia.morphia:morphia-core:2.3.5"
|
||||
library "redis.clients:jedis:5.0.0-beta2"
|
||||
library "org.mariadb.jdbc:mariadb-java-client:3.1.4"
|
||||
library "com.zaxxer:HikariCP:5.0.1"
|
||||
library "org.apache.httpcomponents:httpclient:4.5.13"
|
||||
library "org.apache.commons:commons-lang3:3.12.0"
|
||||
library "org.apache.maven.resolver:maven-resolver-api:1.8.0"
|
||||
library "org.apache.maven.resolver:maven-resolver-impl:1.8.0"
|
||||
library "org.apache.maven.resolver:maven-resolver-connector-basic:1.8.0"
|
||||
library "org.apache.maven.resolver:maven-resolver-transport-http:1.8.0"
|
||||
library "org.apache.maven:maven-resolver-provider:3.8.5"
|
||||
library "org.eclipse.jetty:jetty-server:11.0.9"
|
||||
library "org.eclipse.jetty:jetty-servlet:11.0.9"
|
||||
library "org.eclipse.jetty:jetty-proxy:11.0.9"
|
||||
library "com.google.code.gson:gson:2.9.0"
|
||||
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:1.7") {
|
||||
library "org.apache.maven.resolver:maven-resolver-transport-http:1.9.13"
|
||||
compileOnly "dev.folia:folia-api:1.20.1-R0.1-SNAPSHOT"
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {
|
||||
exclude group: "org.bukkit", module: "bukkit"
|
||||
}
|
||||
implementation "org.bstats:bstats-base:3.0.0"
|
||||
implementation "org.bstats:bstats-bukkit:3.0.0"
|
||||
implementation project(":api")
|
||||
implementation "org.bstats:bstats-base:3.0.2"
|
||||
implementation "org.bstats:bstats-bukkit:3.0.2"
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
@ -41,15 +30,32 @@ shadowJar {
|
||||
relocate "org.bstats", "dev.plex"
|
||||
}
|
||||
|
||||
bukkit {
|
||||
paper {
|
||||
name = "Plex"
|
||||
version = project.version
|
||||
description = "Plex provides a new experience for freedom servers."
|
||||
main = "dev.plex.Plex"
|
||||
loader = "dev.plex.PlexLibraryManager"
|
||||
website = "https://plex.us.org"
|
||||
authors = ["Telesphoreo", "taahanis", "supernt"]
|
||||
softDepend = ["Vault"]
|
||||
apiVersion = "1.18"
|
||||
apiVersion = "1.19"
|
||||
foliaSupported = true
|
||||
generateLibrariesJson = true
|
||||
// Load BukkitTelnet and LibsDisguises before Plex so the modules register properly
|
||||
serverDependencies {
|
||||
'BukkitTelnet' {
|
||||
required = false
|
||||
load = 'BEFORE'
|
||||
}
|
||||
'LibsDisguises' {
|
||||
required = false
|
||||
load = 'BEFORE'
|
||||
}
|
||||
'Vault' {
|
||||
required = false
|
||||
load = 'BEFORE'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String getGitHash() {
|
||||
|
@ -2,19 +2,12 @@ package dev.plex;
|
||||
|
||||
import dev.plex.admin.Admin;
|
||||
import dev.plex.admin.AdminList;
|
||||
import dev.plex.api.PlexApi;
|
||||
import dev.plex.api.PlexApiProvider;
|
||||
import dev.plex.api.plugin.PlexPlugin;
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.cache.PlayerCache;
|
||||
import dev.plex.config.Config;
|
||||
import dev.plex.handlers.CommandHandler;
|
||||
import dev.plex.handlers.ListenerHandler;
|
||||
import dev.plex.hook.VaultHook;
|
||||
import dev.plex.listener.impl.ChatListener;
|
||||
import dev.plex.module.ModuleManager;
|
||||
import dev.plex.permission.handler.NativePermissionHandler;
|
||||
import dev.plex.permission.handler.VaultPermissionHandler;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.punishment.PunishmentManager;
|
||||
import dev.plex.rank.RankManager;
|
||||
@ -33,33 +26,31 @@ import dev.plex.util.BungeeUtil;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.UpdateChecker;
|
||||
import dev.plex.util.redis.MessageUtil;
|
||||
import dev.plex.world.CustomWorld;
|
||||
import java.io.File;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bson.conversions.Bson;
|
||||
import net.milkbowl.vault.chat.Chat;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
public class Plex extends JavaPlugin
|
||||
{
|
||||
public static final BuildInfo build = new BuildInfo();
|
||||
private static Plex plugin;
|
||||
|
||||
public Config config;
|
||||
public Config messages;
|
||||
public Config indefBans;
|
||||
public Config commands;
|
||||
public Config toggles;
|
||||
|
||||
private PlexProvider provider;
|
||||
|
||||
public File modulesFolder;
|
||||
private StorageType storageType = StorageType.SQLITE;
|
||||
|
||||
public static final BuildInfo build = new BuildInfo();
|
||||
|
||||
private SQLConnection sqlConnection;
|
||||
private MongoConnection mongoConnection;
|
||||
private RedisConnection redisConnection;
|
||||
@ -82,6 +73,8 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
private UpdateChecker updateChecker;
|
||||
private String system;
|
||||
|
||||
private Permission permissions;
|
||||
private Chat chat;
|
||||
|
||||
public static Plex get()
|
||||
{
|
||||
@ -110,8 +103,7 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
moduleManager.loadAllModules();
|
||||
moduleManager.loadModules();
|
||||
|
||||
this.setChatHandler(new ChatListener.ChatHandlerImpl());
|
||||
|
||||
//this.setChatHandler(new ChatListener.ChatHandlerImpl());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,21 +137,15 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
boolean permissions = false;
|
||||
if (getServer().getPluginManager().isPluginEnabled("Vault"))
|
||||
if (system.equals("permissions"))
|
||||
{
|
||||
VaultPermissionHandler handler = new VaultPermissionHandler();
|
||||
if (VaultHook.getPermission() != null)
|
||||
if (!getServer().getPluginManager().isPluginEnabled("Vault"))
|
||||
{
|
||||
this.setPermissionHandler(handler);
|
||||
permissions = true;
|
||||
PlexLog.debug("Enabling Vault support for permissions with a permission plugin: " + VaultHook.getPermission().getName());
|
||||
throw new RuntimeException("Vault is required to run on the server if you use permissions!");
|
||||
}
|
||||
}
|
||||
|
||||
if (!permissions)
|
||||
{
|
||||
this.setPermissionHandler(new NativePermissionHandler());
|
||||
permissions = setupPermissions();
|
||||
chat = setupChat();
|
||||
}
|
||||
|
||||
updateChecker = new UpdateChecker();
|
||||
@ -173,6 +159,8 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
{
|
||||
redisConnection.getJedis();
|
||||
PlexLog.log("Connected to Redis!");
|
||||
MessageUtil.subscribe();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -204,7 +192,11 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
punishmentManager.mergeIndefiniteBans();
|
||||
PlexLog.log("Punishment System initialized");
|
||||
|
||||
generateWorlds();
|
||||
if (!PlexUtils.isFolia())
|
||||
{
|
||||
// World generation is not supported on Folia yet
|
||||
generateWorlds();
|
||||
}
|
||||
|
||||
serviceManager = new ServiceManager();
|
||||
PlexLog.log("Service Manager initialized");
|
||||
@ -221,8 +213,6 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
}
|
||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
|
||||
|
||||
provider = new PlexProvider();
|
||||
moduleManager.enableModules();
|
||||
}
|
||||
|
||||
@ -284,9 +274,17 @@ public class Plex extends PlexPlugin implements PlexApiProvider
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlexApi getApi()
|
||||
private Permission setupPermissions()
|
||||
{
|
||||
return provider;
|
||||
RegisteredServiceProvider<Permission> rsp = Bukkit.getServicesManager().getRegistration(Permission.class);
|
||||
permissions = rsp.getProvider();
|
||||
return permissions;
|
||||
}
|
||||
|
||||
private Chat setupChat()
|
||||
{
|
||||
RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
|
||||
chat = rsp.getProvider();
|
||||
return chat;
|
||||
}
|
||||
}
|
||||
|
66
server/src/main/java/dev/plex/PlexLibraryManager.java
Normal file
66
server/src/main/java/dev/plex/PlexLibraryManager.java
Normal file
@ -0,0 +1,66 @@
|
||||
package dev.plex;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.papermc.paper.plugin.loader.PluginClasspathBuilder;
|
||||
import io.papermc.paper.plugin.loader.PluginLoader;
|
||||
import io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.graph.Dependency;
|
||||
import org.eclipse.aether.repository.RemoteRepository;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class PlexLibraryManager implements PluginLoader
|
||||
{
|
||||
@Override
|
||||
public void classloader(@NotNull PluginClasspathBuilder classpathBuilder)
|
||||
{
|
||||
|
||||
MavenLibraryResolver resolver = new MavenLibraryResolver();
|
||||
PluginLibraries pluginLibraries = load();
|
||||
pluginLibraries.asDependencies().forEach(resolver::addDependency);
|
||||
pluginLibraries.asRepositories().forEach(resolver::addRepository);
|
||||
// The plugin is null, a hacky way to check whether to load Jetty or not
|
||||
if (new File("plugins/Plex/modules/Plex-HTTPD.jar").isFile())
|
||||
{
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-server:11.0.15"), null));
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-servlet:11.0.15"), null));
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-proxy:11.0.15"), null));
|
||||
}
|
||||
classpathBuilder.addLibrary(resolver);
|
||||
}
|
||||
|
||||
public PluginLibraries load()
|
||||
{
|
||||
try (var in = getClass().getResourceAsStream("/paper-libraries.json"))
|
||||
{
|
||||
return new Gson().fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), PluginLibraries.class);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private record PluginLibraries(Map<String, String> repositories, List<String> dependencies)
|
||||
{
|
||||
public Stream<Dependency> asDependencies()
|
||||
{
|
||||
return dependencies.stream()
|
||||
.map(d -> new Dependency(new DefaultArtifact(d), null));
|
||||
}
|
||||
|
||||
public Stream<RemoteRepository> asRepositories()
|
||||
{
|
||||
return repositories.entrySet().stream()
|
||||
.map(e -> new RemoteRepository.Builder(e.getKey(), "default", e.getValue()).build());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package dev.plex;
|
||||
|
||||
import dev.plex.api.IPlayerCache;
|
||||
import dev.plex.api.PlexApi;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
|
||||
public class PlexProvider implements PlexApi
|
||||
{
|
||||
@Override
|
||||
public IPlayerCache<PlexPlayer> getPlayerCache()
|
||||
{
|
||||
return Plex.get().getPlayerCache();
|
||||
}
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
package dev.plex.admin;
|
||||
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import java.util.UUID;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Admin object to handle cached admins
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@ import dev.plex.PlexBase;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.storage.StorageType;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
@ -3,6 +3,7 @@ package dev.plex.cache;
|
||||
import dev.plex.Plex;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.storage.StorageType;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package dev.plex.cache;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import dev.plex.api.IPlayerCache;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -10,7 +10,7 @@ import java.util.UUID;
|
||||
* Cache storage
|
||||
*/
|
||||
|
||||
public class PlayerCache implements IPlayerCache<PlexPlayer>
|
||||
public class PlayerCache
|
||||
{
|
||||
/**
|
||||
* A key/value pair where the key is the unique ID of the Plex Player
|
||||
|
@ -4,18 +4,12 @@ import dev.plex.Plex;
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.exception.ConsoleMustDefinePlayerException;
|
||||
import dev.plex.command.exception.ConsoleOnlyException;
|
||||
import dev.plex.command.exception.PlayerNotBannedException;
|
||||
import dev.plex.command.exception.PlayerNotFoundException;
|
||||
import dev.plex.command.exception.*;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
@ -23,15 +17,14 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Superclass for all commands
|
||||
*/
|
||||
@ -132,6 +125,11 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
{
|
||||
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayerMap().get(player.getUniqueId());
|
||||
|
||||
if (plexPlayer == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
if (!plexPlayer.getRankFromString().isAtLeast(getLevel()))
|
||||
@ -150,7 +148,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(player, perms.permission()))
|
||||
if (!perms.permission().isEmpty() && !player.hasPermission(perms.permission()))
|
||||
{
|
||||
send(sender, messageComponent("noPermissionNode", perms.permission()));
|
||||
return true;
|
||||
@ -186,7 +184,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(Bukkit.getOfflinePlayer(plexPlayer.getName()), perms.permission()))
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getPlayer(plexPlayer.getName()), perms.permission()))
|
||||
{
|
||||
send(sender, messageComponent("noPermissionNode", perms.permission()));
|
||||
return true;
|
||||
@ -305,7 +303,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(Bukkit.getOfflinePlayer(plexPlayer.getName()), perms.permission()))
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissions().playerHas(null, Bukkit.getOfflinePlayer(plexPlayer.getName()), perms.permission()))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission));
|
||||
}
|
||||
@ -343,7 +341,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (!perms.permission().isEmpty() && !plugin.getPermissionHandler().hasPermission(player, permission))
|
||||
if (!perms.permission().isEmpty() && !player.hasPermission(perms.permission()))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("noPermissionNode", permission));
|
||||
}
|
||||
@ -364,7 +362,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
return !perms.permission().isEmpty() && plugin.getPermissionHandler().hasPermission(player, permission);
|
||||
return !perms.permission().isEmpty() && player.hasPermission(permission);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -405,7 +403,7 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
return !perms.permission().isEmpty() && plugin.getPermissionHandler().hasPermission(player, permission);
|
||||
return !perms.permission().isEmpty() && player.hasPermission(permission);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package dev.plex.command.annotation;
|
||||
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
package dev.plex.command.blocking;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BlockedCommand
|
||||
{
|
||||
|
@ -1,9 +1,6 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.event.AdminAddEvent;
|
||||
import dev.plex.api.event.AdminRemoveEvent;
|
||||
import dev.plex.api.event.AdminSetRankEvent;
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
@ -12,19 +9,23 @@ import dev.plex.command.annotation.System;
|
||||
import dev.plex.command.exception.ConsoleOnlyException;
|
||||
import dev.plex.command.exception.PlayerNotFoundException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.AdminAddEvent;
|
||||
import dev.plex.event.AdminRemoveEvent;
|
||||
import dev.plex.event.AdminSetRankEvent;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "admin", usage = "/<command> <add <player> | remove <player> | setrank <player> <rank> | list>", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins")
|
||||
@System(value = "ranks")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
@ -7,14 +8,18 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.minimessage.SafeMiniMessage;
|
||||
import dev.plex.util.redis.MessageUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.adminchat", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "adminchat", description = "Talk privately with other admins", usage = "/<command> <message>", aliases = "o,ac,sc,staffchat")
|
||||
public class AdminChatCMD extends PlexCommand
|
||||
@ -24,33 +29,18 @@ public class AdminChatCMD extends PlexCommand
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
if (playerSender != null)
|
||||
{
|
||||
PlexPlayer player = DataUtils.getPlayer(playerSender.getUniqueId());
|
||||
player.setStaffChat(!player.isStaffChat());
|
||||
return messageComponent("adminChatToggled", BooleanUtils.toStringOnOff(player.isStaffChat()));
|
||||
}
|
||||
return usage();
|
||||
}
|
||||
|
||||
adminChat(sender, StringUtils.join(args, " "));
|
||||
String message = StringUtils.join(args, " ");
|
||||
plugin.getServer().getConsoleSender().sendMessage(messageComponent("adminChatFormat", sender.getName(), message));
|
||||
MessageUtil.sendStaffChat(sender, SafeMiniMessage.mmDeserialize(message), PlexUtils.adminChat(sender.getName(), message).toArray(UUID[]::new));
|
||||
return null;
|
||||
}
|
||||
|
||||
private void adminChat(CommandSender sender, String message)
|
||||
{
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayerMap().get(player.getUniqueId());
|
||||
if (plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN) && plexPlayer.isAdminActive())
|
||||
{
|
||||
player.sendMessage(PlexUtils.messageComponent("adminChatFormat", sender.getName(), message));
|
||||
}
|
||||
}
|
||||
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
|
||||
{
|
||||
if (plugin.getPermissionHandler().hasPermission(player, "plex.adminchat"))
|
||||
{
|
||||
player.sendMessage(PlexUtils.messageComponent("adminChatFormat", sender.getName(), message));
|
||||
}
|
||||
}
|
||||
}
|
||||
plugin.getServer().getConsoleSender().sendMessage(PlexUtils.messageComponent("adminChatFormat", sender.getName(), message));
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,14 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.event.GameModeUpdateEvent;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.GameModeUpdateEvent;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -18,6 +17,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.gamemode.adventure", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "adventure", aliases = "gma,egma,eadventure,adventuremode,eadventuremode", description = "Set your own or another player's gamemode to adventure mode")
|
||||
public class AdventureCMD extends PlexCommand
|
||||
@ -29,7 +30,7 @@ public class AdventureCMD extends PlexCommand
|
||||
{
|
||||
if (isConsole(sender))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("consoleMustDefinePlayer"));
|
||||
throw new CommandFailException(messageString("consoleMustDefinePlayer"));
|
||||
}
|
||||
Bukkit.getServer().getPluginManager().callEvent(new GameModeUpdateEvent(sender, playerSender, GameMode.ADVENTURE));
|
||||
return null;
|
||||
|
@ -12,23 +12,20 @@ import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.punishment.Punishment;
|
||||
import dev.plex.punishment.PunishmentType;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.BungeeUtil;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import dev.plex.util.WebUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import dev.plex.util.*;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandParameters(name = "ban", usage = "/<command> <player> [reason]", aliases = "offlineban,gtfo", description = "Bans a player, offline or online")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.ban", source = RequiredCommandSource.ANY)
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class CommandSpyCMD extends PlexCommand
|
||||
{
|
||||
if (playerSender != null)
|
||||
{
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(playerSender.getUniqueId());
|
||||
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayer(playerSender.getUniqueId());
|
||||
plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy());
|
||||
DataUtils.update(plexPlayer);
|
||||
send(sender, messageComponent("toggleCommandSpy")
|
||||
|
@ -7,7 +7,7 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -1,15 +1,14 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.event.GameModeUpdateEvent;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.GameModeUpdateEvent;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -18,6 +17,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.gamemode.creative", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "creative", aliases = "gmc,egmc,ecreative,eecreative,creativemode,ecreativemode", description = "Set your own or another player's gamemode to creative mode")
|
||||
public class CreativeCMD extends PlexCommand
|
||||
@ -29,7 +30,7 @@ public class CreativeCMD extends PlexCommand
|
||||
{
|
||||
if (isConsole(sender))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("consoleMustDefinePlayer"));
|
||||
throw new CommandFailException(messageString("consoleMustDefinePlayer"));
|
||||
}
|
||||
if (!(playerSender == null))
|
||||
{
|
||||
|
@ -9,9 +9,6 @@ import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.GameRuleUtil;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -22,6 +19,10 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@CommandParameters(name = "pdebug", description = "Plex's debug command", usage = "/<command> <aliases <command> | redis-reset <player> | gamerules>")
|
||||
@CommandPermissions(level = Rank.EXECUTIVE, permission = "plex.debug")
|
||||
@System(debug = true)
|
||||
@ -36,13 +37,16 @@ public class DebugCMD extends PlexCommand
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("redis-reset"))
|
||||
{
|
||||
Player player = getNonNullPlayer(args[1]);
|
||||
if (plugin.getRedisConnection().getJedis().exists(player.getUniqueId().toString()))
|
||||
if (args.length == 2)
|
||||
{
|
||||
plugin.getRedisConnection().getJedis().del(player.getUniqueId().toString());
|
||||
return componentFromString("Successfully reset " + player.getName() + "'s Redis punishments!").color(NamedTextColor.YELLOW);
|
||||
Player player = getNonNullPlayer(args[1]);
|
||||
if (plugin.getRedisConnection().getJedis().exists(player.getUniqueId().toString()))
|
||||
{
|
||||
plugin.getRedisConnection().getJedis().del(player.getUniqueId().toString());
|
||||
return componentFromString("Successfully reset " + player.getName() + "'s Redis punishments!").color(NamedTextColor.YELLOW);
|
||||
}
|
||||
return componentFromString("Couldn't find player in Redis punishments.");
|
||||
}
|
||||
return componentFromString("Couldn't find player in Redis punishments.");
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("gamerules"))
|
||||
{
|
||||
@ -64,15 +68,18 @@ public class DebugCMD extends PlexCommand
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("aliases"))
|
||||
{
|
||||
String commandName = args[1];
|
||||
Command command = plugin.getServer().getCommandMap().getCommand(commandName);
|
||||
if (command == null)
|
||||
if (args.length == 2)
|
||||
{
|
||||
return mmString("<red>That command could not be found!");
|
||||
String commandName = args[1];
|
||||
Command command = plugin.getServer().getCommandMap().getCommand(commandName);
|
||||
if (command == null)
|
||||
{
|
||||
return mmString("<red>That command could not be found!");
|
||||
}
|
||||
return mmString("<aqua>Aliases for " + commandName + " are: " + Arrays.toString(command.getAliases().toArray(new String[0])));
|
||||
}
|
||||
return mmString("<aqua>Aliases for " + commandName + " are: " + Arrays.toString(command.getAliases().toArray(new String[0])));
|
||||
}
|
||||
return null;
|
||||
return usage();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,13 +7,14 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.annotation.System;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "deop", description = "Deop a player on the server", usage = "/<command> <player>")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.deop")
|
||||
@System(value = "ranks")
|
||||
|
@ -6,11 +6,6 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
@ -21,6 +16,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.entitywipe", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "entitywipe", description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/<command> [name]", aliases = "ew,rd")
|
||||
public class EntityWipeCMD extends PlexCommand
|
||||
|
@ -10,15 +10,16 @@ import dev.plex.punishment.PunishmentType;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "freeze", description = "Freeze a player on the server", usage = "/<command> <player>", aliases = "fr")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.freeze")
|
||||
public class FreezeCMD extends PlexCommand
|
||||
|
@ -1,16 +1,13 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import dev.plex.api.event.GameModeUpdateEvent;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.GameModeUpdateEvent;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -19,6 +16,10 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "gamemode", usage = "/<command> <creative | survival | adventure | default | spectator> [player]", description = "Change your gamemode", aliases = "gm,egamemode,gmt,egmt")
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.gamemode", source = RequiredCommandSource.ANY)
|
||||
public class GamemodeCMD extends PlexCommand
|
||||
|
@ -14,17 +14,18 @@ import dev.plex.util.BungeeUtil;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import dev.plex.util.WebUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandParameters(name = "kick", description = "Kicks a player", usage = "/<command> <player>")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.kick", source = RequiredCommandSource.ANY)
|
||||
public class KickCMD extends PlexCommand
|
||||
@ -56,9 +57,9 @@ public class KickCMD extends PlexCommand
|
||||
if (args.length > 1)
|
||||
{
|
||||
reason = StringUtils.join(args, " ", 1, args.length);
|
||||
punishment.setReason(reason);
|
||||
}
|
||||
|
||||
punishment.setReason(reason);
|
||||
punishment.setPunishedUsername(plexPlayer.getName());
|
||||
punishment.setEndDate(ZonedDateTime.now(ZoneId.of(TimeUtils.TIMEZONE)));
|
||||
punishment.setCustomTime(false);
|
||||
|
@ -4,9 +4,8 @@ import com.google.common.collect.Lists;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.annotation.System;
|
||||
import dev.plex.hook.VaultHook;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -15,9 +14,10 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "list", description = "Show a list of all online players", aliases = "lsit")
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "list", description = "Show a list of all online players", aliases = "lsit,who,playerlist,online")
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.list")
|
||||
@System(value = "ranks")
|
||||
public class ListCMD extends PlexCommand
|
||||
{
|
||||
@Override
|
||||
@ -44,7 +44,14 @@ public class ListCMD extends PlexCommand
|
||||
for (int i = 0; i < players.size(); i++)
|
||||
{
|
||||
Player player = players.get(i);
|
||||
list = list.append(getPlexPlayer(player).getRankFromString().getPrefix()).append(Component.space()).append(Component.text(player.getName()).color(NamedTextColor.WHITE));
|
||||
if (plugin.getSystem().equals("ranks"))
|
||||
{
|
||||
list = list.append(getPlexPlayer(player).getRankFromString().getPrefix()).append(Component.space()).append(Component.text(player.getName()).color(NamedTextColor.WHITE));
|
||||
}
|
||||
else
|
||||
{
|
||||
list = list.append(VaultHook.getPrefix(getPlexPlayer(player))).append(Component.space()).append(Component.text(player.getName()).color(NamedTextColor.WHITE));
|
||||
}
|
||||
if (i != players.size() - 1)
|
||||
{
|
||||
list = list.append(Component.text(",")).append(Component.space());
|
||||
|
@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "localspawn", description = "Teleport to the spawnpoint of the world you are in")
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.spawnpoint", source = RequiredCommandSource.IN_GAME)
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.localspawn", source = RequiredCommandSource.IN_GAME)
|
||||
public class LocalSpawnCMD extends PlexCommand
|
||||
{
|
||||
@Override
|
||||
|
@ -7,13 +7,14 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "lockup", description = "Lockup a player on the server", usage = "/<command> <player>")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.lockup")
|
||||
public class LockupCMD extends PlexCommand
|
||||
|
@ -6,7 +6,6 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.HashMap;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
@ -17,6 +16,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.mobpurge", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "mobpurge", description = "Purge all mobs.", usage = "/<command>", aliases = "mp")
|
||||
public class MobPurgeCMD extends PlexCommand
|
||||
|
@ -10,15 +10,16 @@ import dev.plex.punishment.PunishmentType;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "mute", description = "Mute a player on the server", usage = "/<command> <player>", aliases = "stfu")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.mute")
|
||||
public class MuteCMD extends PlexCommand
|
||||
|
@ -6,13 +6,7 @@ import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.AshconInfo;
|
||||
import dev.plex.util.MojangUtils;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import dev.plex.util.*;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -20,6 +14,9 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "namehistory", description = "Get the name history of a player", usage = "/<command> <player>", aliases = "nh")
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.namehistory")
|
||||
public class NameHistoryCMD extends PlexCommand
|
||||
|
@ -10,12 +10,6 @@ import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.storage.StorageType;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@ -25,6 +19,13 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@CommandParameters(name = "notes", description = "Manage notes for a player", usage = "/<command> <player> <list | add <note> | remove <id> | clear>")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.notes")
|
||||
public class NotesCMD extends PlexCommand
|
||||
|
@ -7,13 +7,14 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.annotation.System;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "op", description = "Op a player on the server", usage = "/<command> <player>")
|
||||
@CommandPermissions(level = Rank.OP)
|
||||
@System(value = "ranks")
|
||||
|
@ -11,12 +11,8 @@ import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.BuildInfo;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -24,6 +20,11 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@CommandPermissions(level = Rank.IMPOSTOR, source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "plex", usage = "/<command> [reload | redis | modules [reload]]", description = "Show information about Plex or reload it")
|
||||
public class PlexCMD extends PlexCommand
|
||||
|
@ -8,13 +8,14 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.menu.PunishmentMenu;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "punishments", usage = "/<command> [player]", description = "Opens the Punishments GUI", aliases = "punishlist,punishes")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.punishments", source = RequiredCommandSource.IN_GAME)
|
||||
public class PunishmentsCMD extends PlexCommand
|
||||
|
@ -8,14 +8,15 @@ import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.rank", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "rank", description = "Displays your rank")
|
||||
@System(value = "ranks")
|
||||
|
@ -7,7 +7,7 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -0,0 +1,55 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.removeloginmessage", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "removeloginmessage", usage = "/<command> [-o <player>]", description = "Remove your own (or someone else's) login message", aliases = "rlm,removeloginmsg")
|
||||
public class RemoveLoginMessageCMD extends PlexCommand
|
||||
{
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
|
||||
{
|
||||
if (args.length == 0 && !isConsole(sender))
|
||||
{
|
||||
if (playerSender != null)
|
||||
{
|
||||
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayer(playerSender.getUniqueId());
|
||||
plexPlayer.setLoginMessage("");
|
||||
return messageComponent("removedOwnLoginMessage");
|
||||
}
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("-o"))
|
||||
{
|
||||
checkRank(sender, Rank.SENIOR_ADMIN, "plex.removeloginmessage.others");
|
||||
|
||||
if (args.length < 2)
|
||||
{
|
||||
return messageComponent("specifyPlayer");
|
||||
}
|
||||
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(args[1]);
|
||||
if (plexPlayer == null)
|
||||
{
|
||||
return messageComponent("playerNotFound");
|
||||
}
|
||||
plexPlayer.setLoginMessage("");
|
||||
return messageComponent("removedOtherLoginMessage", plexPlayer.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
return messageComponent("noPermissionConsole");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -0,0 +1,89 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import dev.plex.cache.DataUtils;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexLog;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.setloginmessage", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "setloginmessage", usage = "/<command> [-o <player>] <message>", description = "Sets your (or someone else's) login message", aliases = "slm,setloginmsg")
|
||||
public class SetLoginMessageCMD extends PlexCommand
|
||||
{
|
||||
private final boolean nameRequired = plugin.getConfig().getBoolean("loginmessages.name");
|
||||
private final boolean rankRequired = plugin.getConfig().getBoolean("loginmessages.rank");
|
||||
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
return usage();
|
||||
}
|
||||
if (playerSender != null)
|
||||
{
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
checkRank(sender, Rank.SENIOR_ADMIN, "plex.setloginmessage.others");
|
||||
|
||||
if (args.length < 2)
|
||||
{
|
||||
return messageComponent("specifyPlayer");
|
||||
}
|
||||
if (args.length < 3)
|
||||
{
|
||||
return messageComponent("specifyLoginMessage");
|
||||
}
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(args[1]);
|
||||
if (plexPlayer == null)
|
||||
{
|
||||
return messageComponent("playerNotFound");
|
||||
}
|
||||
String message = StringUtils.join(args, " ", 2, args.length);
|
||||
message = message.replace(plexPlayer.getName(), "%player%");
|
||||
validateMessage(message);
|
||||
plexPlayer.setLoginMessage(message);
|
||||
return messageComponent("setOtherPlayersLoginMessage", plexPlayer.getName(),
|
||||
message.replace("%player%", plexPlayer.getName())
|
||||
.replace("%rank%", plexPlayer.getRank()));
|
||||
}
|
||||
if (isConsole(sender))
|
||||
{
|
||||
return messageComponent("noPermissionConsole");
|
||||
}
|
||||
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayer(playerSender.getUniqueId());
|
||||
String message = StringUtils.join(args, " ", 0, args.length);
|
||||
message = message.replace(plexPlayer.getName(), "%player%");
|
||||
validateMessage(message);
|
||||
plexPlayer.setLoginMessage(message);
|
||||
return messageComponent("setOwnLoginMessage",
|
||||
message.replace("%player%", plexPlayer.getName())
|
||||
.replace("%rank%", plexPlayer.getRank()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void validateMessage(String message)
|
||||
{
|
||||
if (nameRequired && !message.contains("%player%"))
|
||||
{
|
||||
PlexLog.debug("Validating login message has a valid name in it");
|
||||
throw new CommandFailException(messageString("nameRequired"));
|
||||
}
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks") && rankRequired && !message.contains("%rank%"))
|
||||
{
|
||||
PlexLog.debug("Validating login message has a valid rank in it");
|
||||
throw new CommandFailException(messageString("rankRequired"));
|
||||
}
|
||||
}
|
||||
}
|
@ -10,15 +10,11 @@ import dev.plex.punishment.PunishmentType;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@ -27,6 +23,11 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.smite", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "smite", usage = "/<command> <player> [reason] [-ci | -q]", description = "Someone being a little bitch? Smite them down...")
|
||||
public class SmiteCMD extends PlexCommand
|
||||
|
@ -1,15 +1,14 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.event.GameModeUpdateEvent;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.GameModeUpdateEvent;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -18,6 +17,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.gamemode.spectator", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "spectator", aliases = "gmsp,egmsp,spec", description = "Set your own or another player's gamemode to spectator mode")
|
||||
public class SpectatorCMD extends PlexCommand
|
||||
@ -29,7 +30,7 @@ public class SpectatorCMD extends PlexCommand
|
||||
{
|
||||
if (isConsole(sender))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("consoleMustDefinePlayer"));
|
||||
throw new CommandFailException(messageString("consoleMustDefinePlayer"));
|
||||
}
|
||||
Bukkit.getServer().getPluginManager().callEvent(new GameModeUpdateEvent(sender, playerSender, GameMode.SPECTATOR));
|
||||
return null;
|
||||
|
@ -1,15 +1,14 @@
|
||||
package dev.plex.command.impl;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.event.GameModeUpdateEvent;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.event.GameModeUpdateEvent;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -18,6 +17,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.gamemode.survival", source = RequiredCommandSource.ANY)
|
||||
@CommandParameters(name = "survival", aliases = "gms,egms,esurvival,survivalmode,esurvivalmode", description = "Set your own or another player's gamemode to survival mode")
|
||||
public class SurvivalCMD extends PlexCommand
|
||||
@ -29,7 +30,7 @@ public class SurvivalCMD extends PlexCommand
|
||||
{
|
||||
if (isConsole(sender))
|
||||
{
|
||||
throw new CommandFailException(PlexUtils.messageString("consoleMustDefinePlayer"));
|
||||
throw new CommandFailException(messageString("consoleMustDefinePlayer"));
|
||||
}
|
||||
Bukkit.getServer().getPluginManager().callEvent(new GameModeUpdateEvent(sender, playerSender, GameMode.SURVIVAL));
|
||||
return null;
|
||||
|
@ -7,8 +7,6 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.inventory.Book;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -16,6 +14,9 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "totalfreedommod", description = "You can't simpy do that.", aliases = "tfm")
|
||||
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
|
||||
|
||||
|
@ -7,11 +7,12 @@ import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.minimessage.SafeMiniMessage;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -46,7 +47,7 @@ public class TagCMD extends PlexCommand
|
||||
{
|
||||
return usage("/tag set <prefix>");
|
||||
}
|
||||
String prefix = StringUtils.join(args, " ", 1, args.length);
|
||||
String prefix = PlexUtils.cleanString(StringUtils.join(args, " ", 1, args.length));
|
||||
|
||||
Component convertedComponent = SafeMiniMessage.mmDeserializeWithoutEvents(prefix);
|
||||
|
||||
|
@ -15,16 +15,17 @@ import dev.plex.util.BungeeUtil;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.TimeUtils;
|
||||
import dev.plex.util.WebUtils;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandParameters(name = "tempban", usage = "/<command> <player> <time> [reason]", description = "Temporarily ban a player")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.tempban", source = RequiredCommandSource.ANY)
|
||||
|
||||
|
@ -8,7 +8,6 @@ import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.menu.ToggleMenu;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -16,6 +15,8 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "toggle", description = "Allows toggling various server aspects through a GUI", aliases = "toggles")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.toggle", source = RequiredCommandSource.ANY)
|
||||
public class ToggleCMD extends PlexCommand
|
||||
@ -31,6 +32,7 @@ public class ToggleCMD extends PlexCommand
|
||||
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Explosions" + status("explosions")));
|
||||
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Fluidspread" + status("fluidspread")));
|
||||
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Drops" + status("drops")));
|
||||
sender.sendMessage(PlexUtils.mmDeserialize("<gray> - Redstone" + status("redstone")));
|
||||
return null;
|
||||
}
|
||||
switch (args[0].toLowerCase())
|
||||
@ -47,6 +49,10 @@ public class ToggleCMD extends PlexCommand
|
||||
{
|
||||
return toggle("drops");
|
||||
}
|
||||
case "redstone" ->
|
||||
{
|
||||
return toggle("redstone");
|
||||
}
|
||||
default ->
|
||||
{
|
||||
return messageComponent("invalidToggle");
|
||||
|
@ -12,14 +12,15 @@ import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.WebUtils;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@CommandParameters(name = "unban", usage = "/<command> <player>", description = "Unbans a player, offline or online")
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.ban", source = RequiredCommandSource.ANY)
|
||||
|
||||
|
@ -8,13 +8,14 @@ import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.unfreeze")
|
||||
@CommandParameters(name = "unfreeze", description = "Unfreeze a player", usage = "/<command> <player>")
|
||||
public class UnfreezeCMD extends PlexCommand
|
||||
|
@ -8,13 +8,14 @@ import dev.plex.command.exception.CommandFailException;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, permission = "plex.unmute")
|
||||
@CommandParameters(name = "unmute", description = "Unmute a player", usage = "/<command> <player>")
|
||||
public class UnmuteCMD extends PlexCommand
|
||||
|
@ -6,8 +6,6 @@ import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -17,6 +15,9 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, permission = "plex.world", source = RequiredCommandSource.IN_GAME)
|
||||
@CommandParameters(name = "world", description = "Teleport to a world.", usage = "/<command> <world>")
|
||||
public class WorldCMD extends PlexCommand
|
||||
|
@ -2,10 +2,11 @@ package dev.plex.config;
|
||||
|
||||
import dev.plex.Plex;
|
||||
import dev.plex.util.PlexLog;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
/**
|
||||
* Creates a custom Config object
|
||||
|
@ -1,11 +1,12 @@
|
||||
package dev.plex.config;
|
||||
|
||||
import dev.plex.module.PlexModule;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
/**
|
||||
* Creates a custom Config object
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -24,7 +24,7 @@ public class AdminAddEvent extends Event
|
||||
/**
|
||||
* The PlexPlayer that was added
|
||||
*/
|
||||
private final IPlexPlayer plexPlayer;
|
||||
private final PlexPlayer plexPlayer;
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -24,7 +24,7 @@ public class AdminRemoveEvent extends Event
|
||||
/**
|
||||
* The PlexPlayer that was removed
|
||||
*/
|
||||
private final IPlexPlayer plexPlayer;
|
||||
private final PlexPlayer plexPlayer;
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.api.rank.IRank;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.rank.enums.Rank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -25,12 +25,12 @@ public class AdminSetRankEvent extends Event
|
||||
/**
|
||||
* The PlexPlayer that was removed
|
||||
*/
|
||||
private final IPlexPlayer plexPlayer;
|
||||
private final PlexPlayer plexPlayer;
|
||||
|
||||
/**
|
||||
* The rank the player was set to
|
||||
*/
|
||||
private final IRank rank;
|
||||
private final Rank rank;
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -16,7 +16,7 @@ public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancell
|
||||
/**
|
||||
* The player who was punished
|
||||
*/
|
||||
protected IPlexPlayer punishedPlayer;
|
||||
protected PlexPlayer punishedPlayer;
|
||||
|
||||
/**
|
||||
* Whether the event was cancelled
|
||||
@ -28,9 +28,9 @@ public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancell
|
||||
* Creates an event object
|
||||
*
|
||||
* @param punishedPlayer The player who was punished
|
||||
* @see IPlexPlayer
|
||||
* @see PlexPlayer
|
||||
*/
|
||||
protected PunishedPlayerEvent(IPlexPlayer punishedPlayer)
|
||||
protected PunishedPlayerEvent(PlexPlayer punishedPlayer)
|
||||
{
|
||||
super(Bukkit.getPlayer(punishedPlayer.getUuid()));
|
||||
this.punishedPlayer = punishedPlayer;
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -24,7 +24,7 @@ public class PunishedPlayerFreezeEvent extends PunishedPlayerEvent implements Ca
|
||||
* @param punishedPlayer The player who was punished
|
||||
* @param frozen The new frozen status
|
||||
*/
|
||||
public PunishedPlayerFreezeEvent(IPlexPlayer punishedPlayer, boolean frozen)
|
||||
public PunishedPlayerFreezeEvent(PlexPlayer punishedPlayer, boolean frozen)
|
||||
{
|
||||
super(punishedPlayer);
|
||||
this.frozen = frozen;
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -24,7 +24,7 @@ public class PunishedPlayerLockupEvent extends PunishedPlayerEvent implements Ca
|
||||
* @param punishedPlayer The player who was punished
|
||||
* @param lockedUp The new muted status
|
||||
*/
|
||||
public PunishedPlayerLockupEvent(IPlexPlayer punishedPlayer, boolean lockedUp)
|
||||
public PunishedPlayerLockupEvent(PlexPlayer punishedPlayer, boolean lockedUp)
|
||||
{
|
||||
super(punishedPlayer);
|
||||
this.lockedUp = lockedUp;
|
@ -1,6 +1,6 @@
|
||||
package dev.plex.api.event;
|
||||
package dev.plex.event;
|
||||
|
||||
import dev.plex.api.player.IPlexPlayer;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@ -24,7 +24,7 @@ public class PunishedPlayerMuteEvent extends PunishedPlayerEvent implements Canc
|
||||
* @param punishedPlayer The player who was punished
|
||||
* @param muted The new muted status
|
||||
*/
|
||||
public PunishedPlayerMuteEvent(IPlexPlayer punishedPlayer, boolean muted)
|
||||
public PunishedPlayerMuteEvent(PlexPlayer punishedPlayer, boolean muted)
|
||||
{
|
||||
super(punishedPlayer);
|
||||
this.muted = muted;
|
@ -6,6 +6,7 @@ import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.System;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.ReflectionsUtil;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user