mirror of
https://github.com/plexusorg/Module-TFMExtras.git
synced 2026-06-03 23:26:55 +00:00
Remove AWSM
This commit is contained in:
@@ -7,12 +7,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Set up JDK 21
|
- name: Set up JDK 25
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 21
|
java-version: 25
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: chmod a+x gradlew && ./gradlew build --no-daemon
|
run: chmod a+x gradlew && ./gradlew build --no-daemon
|
||||||
+7
-15
@@ -12,31 +12,23 @@ repositories {
|
|||||||
url = uri("https://nexus.telesphoreo.me/repository/plex/")
|
url = uri("https://nexus.telesphoreo.me/repository/plex/")
|
||||||
}
|
}
|
||||||
|
|
||||||
maven {
|
|
||||||
url = uri("https://repo.infernalsuite.com/repository/maven-snapshots/")
|
|
||||||
}
|
|
||||||
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
// mavenLocal()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.projectlombok:lombok:1.18.42")
|
compileOnly("org.projectlombok:lombok:1.18.46")
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.42")
|
annotationProcessor("org.projectlombok:lombok:1.18.46")
|
||||||
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
compileOnly("io.papermc.paper:paper-api:26.1.2.build.+")
|
||||||
implementation("org.apache.commons:commons-lang3:3.19.0")
|
implementation("org.apache.commons:commons-lang3:3.20.0")
|
||||||
compileOnly("dev.plex:server:1.6")
|
compileOnly("dev.plex:api:2.0-SNAPSHOT")
|
||||||
compileOnly("com.infernalsuite.aswm:api:1.20.6-R0.1-SNAPSHOT") {
|
|
||||||
exclude(group = "com.flowpowered")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.plex"
|
group = "dev.plex"
|
||||||
version = "1.6"
|
version = "2.0-SNAPSHOT"
|
||||||
description = "Module-TFMExtras"
|
description = "Module-TFMExtras"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -86,8 +86,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -115,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -173,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -206,15 +203,14 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+10
-22
@@ -23,8 +23,8 @@
|
|||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
setlocal EnableExtensions
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
@@ -65,30 +65,18 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|
||||||
:end
|
:exitWithErrorLevel
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
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
|
|
||||||
|
|
||||||
:omega
|
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ import dev.plex.command.PlexCommand;
|
|||||||
import dev.plex.command.annotation.CommandParameters;
|
import dev.plex.command.annotation.CommandParameters;
|
||||||
import dev.plex.command.annotation.CommandPermissions;
|
import dev.plex.command.annotation.CommandPermissions;
|
||||||
import dev.plex.config.ModuleConfig;
|
import dev.plex.config.ModuleConfig;
|
||||||
import dev.plex.extras.command.slime.MyWorldCommand;
|
|
||||||
import dev.plex.extras.command.slime.SlimeManagerCommand;
|
|
||||||
import dev.plex.extras.hook.SlimeWorldHook;
|
|
||||||
import dev.plex.extras.island.storage.IslandHandler;
|
|
||||||
import dev.plex.extras.jumppads.JumpPads;
|
import dev.plex.extras.jumppads.JumpPads;
|
||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
import dev.plex.module.PlexModule;
|
import dev.plex.module.PlexModule;
|
||||||
@@ -35,12 +31,6 @@ public class TFMExtras extends PlexModule
|
|||||||
@Getter
|
@Getter
|
||||||
private ModuleConfig config;
|
private ModuleConfig config;
|
||||||
|
|
||||||
@Getter
|
|
||||||
private SlimeWorldHook slimeWorldHook;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final IslandHandler islandHandler = new IslandHandler();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
@@ -48,24 +38,12 @@ public class TFMExtras extends PlexModule
|
|||||||
config = new ModuleConfig(this, "tfmextras/config.yml", "config.yml");
|
config = new ModuleConfig(this, "tfmextras/config.yml", "config.yml");
|
||||||
config.load();
|
config.load();
|
||||||
jumpPads = new JumpPads();
|
jumpPads = new JumpPads();
|
||||||
if (enableIslands())
|
|
||||||
{
|
|
||||||
slimeWorldHook = new SlimeWorldHook();
|
|
||||||
}
|
|
||||||
// PlexLog.debug(String.valueOf(config.getInt("server.jumppad_strength")));
|
// PlexLog.debug(String.valueOf(config.getInt("server.jumppad_strength")));
|
||||||
// PlexLog.log("Test map: {0}", StringUtils.join(SQLUtil.createTable(Lists.newArrayList(), PlayerWorld.class), "\n"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enable()
|
public void enable()
|
||||||
{
|
{
|
||||||
if (enableIslands())
|
|
||||||
{
|
|
||||||
slimeWorldHook.onEnable(this);
|
|
||||||
registerCommand(new SlimeManagerCommand());
|
|
||||||
registerCommand(new MyWorldCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
getClassesFrom("dev.plex.extras.command").forEach(aClass ->
|
getClassesFrom("dev.plex.extras.command").forEach(aClass ->
|
||||||
{
|
{
|
||||||
if (PlexCommand.class.isAssignableFrom(aClass) && aClass.isAnnotationPresent(CommandParameters.class) && aClass.isAnnotationPresent(CommandPermissions.class))
|
if (PlexCommand.class.isAssignableFrom(aClass) && aClass.isAnnotationPresent(CommandParameters.class) && aClass.isAnnotationPresent(CommandPermissions.class))
|
||||||
@@ -110,17 +88,6 @@ public class TFMExtras extends PlexModule
|
|||||||
addDefaultMessage("attributeList", "<gold>All possible attributes: <yellow>{0}", "0 - The attribute list, each split by a new line");
|
addDefaultMessage("attributeList", "<gold>All possible attributes: <yellow>{0}", "0 - The attribute list, each split by a new line");
|
||||||
addDefaultMessage("modifiedAutoClear", "<gold>{0} will {1} have their inventory cleared when they join.", "0 - The player who will have their inventory cleared on join", "1 - Whether they had this option toggled (returns: 'no longer', 'now')");
|
addDefaultMessage("modifiedAutoClear", "<gold>{0} will {1} have their inventory cleared when they join.", "0 - The player who will have their inventory cleared on join", "1 - Whether they had this option toggled (returns: 'no longer', 'now')");
|
||||||
addDefaultMessage("modifiedAutoTeleport", "<gold>{0} will {1} be teleported automatically when they join.", "0 - The player to be teleported automatically", "1 - Whether they had this option toggled (returns: 'no longer', 'now')");
|
addDefaultMessage("modifiedAutoTeleport", "<gold>{0} will {1} be teleported automatically when they join.", "0 - The player to be teleported automatically", "1 - Whether they had this option toggled (returns: 'no longer', 'now')");
|
||||||
addDefaultMessage("createdPlayerWorld", "<green>Welcome to the server! We've created you a new private world where you can invite your friends! View how to use this using /myworld and visit it using /myworld goto!");
|
|
||||||
addDefaultMessage("playerWorldExists", "<red>Hey! Your world seems to already exist, go to it using /myworld goto");
|
|
||||||
addDefaultMessage("selfPlayerWorldNotFound", "<red>Hey! You don't seem to own a world yet. Go ahead and run /myworld create and then run /myworld for more help!");
|
|
||||||
addDefaultMessage("playerWorldNotFound", "<red>Hey! This player's world does not seem to exist. Are they online?");
|
|
||||||
addDefaultMessage("worldLoadError", "<red>Hey! It looks like something went wrong when this world was being loaded in, please try asking the player (or if it is yours, then rejoin) to rejoin and if not, tell the world owner to contact support on our <click:open_url:https://discord.gg/6QcT7K2Bkw><bold>Discord</bold></click>");
|
|
||||||
addDefaultMessage("cannotAccessIsland", "<red>Unfortunately you cannot access this player's island!");
|
|
||||||
addDefaultMessage("islandPermissionUpdated", "<green>Your island permission for {0} has been updated to {1}.", "0 - Permission name", "1 - New value");
|
|
||||||
addDefaultMessage("cantModifyIsland", "<red>You can't modify this player's island!");
|
|
||||||
addDefaultMessage("cantVisitIsland", "<red>You can't visit this player's island!");
|
|
||||||
addDefaultMessage("islandMemberExists", "<red>This player is already a member of your island!");
|
|
||||||
addDefaultMessage("receivedInviteForIsland", "<green>You have been invited to join "); //TODO: Finish this message... my laptop isn't liking minecraft so I can't do formatting for it, and do receivedInviteForIsland message
|
|
||||||
addDefaultMessage("playersExpelled", "<gray>Pushed away players: <white><em>{0}", "0 - The list of players");
|
addDefaultMessage("playersExpelled", "<gray>Pushed away players: <white><em>{0}", "0 - The list of players");
|
||||||
addDefaultMessage("enchantList", "<dark_gray>All possible enchantments are for this item are: <gray>{0}", "0 - A comma-separated list of enchantment names");
|
addDefaultMessage("enchantList", "<dark_gray>All possible enchantments are for this item are: <gray>{0}", "0 - A comma-separated list of enchantment names");
|
||||||
addDefaultMessage("enchantAddAll", "<gray>Added all possible enchantments for this item.");
|
addDefaultMessage("enchantAddAll", "<gray>Added all possible enchantments for this item.");
|
||||||
@@ -137,10 +104,6 @@ public class TFMExtras extends PlexModule
|
|||||||
public void disable()
|
public void disable()
|
||||||
{
|
{
|
||||||
// Unregistering listeners / commands is handled by Plex
|
// Unregistering listeners / commands is handled by Plex
|
||||||
if (enableIslands())
|
|
||||||
{
|
|
||||||
slimeWorldHook.onDisable(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Location getRandomLocation(World world)
|
public static Location getRandomLocation(World world)
|
||||||
@@ -182,16 +145,4 @@ public class TFMExtras extends PlexModule
|
|||||||
return Collections.unmodifiableSet(classes);
|
return Collections.unmodifiableSet(classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean enableIslands()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Class.forName("com.infernalsuite.aswm.api.exceptions.UnknownWorldException");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception ignored)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
package dev.plex.extras.command.slime;
|
|
||||||
|
|
||||||
import dev.plex.Plex;
|
|
||||||
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.PlayerNotFoundException;
|
|
||||||
import dev.plex.command.source.RequiredCommandSource;
|
|
||||||
import dev.plex.extras.TFMExtras;
|
|
||||||
import dev.plex.extras.island.PlayerWorld;
|
|
||||||
import dev.plex.extras.island.info.IslandPermissions;
|
|
||||||
import dev.plex.player.PlexPlayer;
|
|
||||||
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.Sound;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
@CommandParameters(name = "myworld", usage = "/<command> <create | goto | info | invite | remove | settings> [player]")
|
|
||||||
@CommandPermissions(permission = "plex.tfmextras.myworld", source = RequiredCommandSource.IN_GAME)
|
|
||||||
public class MyWorldCommand extends PlexCommand
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
|
||||||
{
|
|
||||||
assert player != null;
|
|
||||||
if (args.length == 0)
|
|
||||||
{
|
|
||||||
return usage();
|
|
||||||
}
|
|
||||||
if (!TFMExtras.getModule().enableIslands())
|
|
||||||
{
|
|
||||||
return mmString("<red>Islands are not enabled on this server!");
|
|
||||||
}
|
|
||||||
switch (args[0].toLowerCase())
|
|
||||||
{
|
|
||||||
case "create" ->
|
|
||||||
{
|
|
||||||
if (TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()))
|
|
||||||
{
|
|
||||||
return messageComponent("playerWorldExists");
|
|
||||||
}
|
|
||||||
TFMExtras.getModule().getSlimeWorldHook().createPlayerWorld(player.getUniqueId());
|
|
||||||
return messageComponent("createdPlayerWorld");
|
|
||||||
}
|
|
||||||
case "goto" ->
|
|
||||||
{
|
|
||||||
if (args.length == 1)
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()))
|
|
||||||
{
|
|
||||||
return messageComponent("selfPlayerWorldNotFound");
|
|
||||||
}
|
|
||||||
World world = Bukkit.getWorld(player.getUniqueId().toString());
|
|
||||||
if (world == null)
|
|
||||||
{
|
|
||||||
return messageComponent("worldLoadError");
|
|
||||||
}
|
|
||||||
player.teleportAsync(world.getSpawnLocation());
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1f, 1f);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
final Player target = Bukkit.getPlayer(args[1]);
|
|
||||||
if (target == null)
|
|
||||||
{
|
|
||||||
throw new PlayerNotFoundException();
|
|
||||||
}
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(target.getUniqueId().toString()))
|
|
||||||
{
|
|
||||||
return messageComponent("playerWorldNotFound");
|
|
||||||
}
|
|
||||||
World world = Bukkit.getWorld(target.getUniqueId().toString());
|
|
||||||
if (world == null)
|
|
||||||
{
|
|
||||||
return messageComponent("worldLoadError");
|
|
||||||
}
|
|
||||||
final PlayerWorld playerWorld = TFMExtras.getModule().getIslandHandler().loadedIslands().get(target.getUniqueId());
|
|
||||||
if (playerWorld != null)
|
|
||||||
{
|
|
||||||
if (playerWorld.visitPermission() == IslandPermissions.NOBODY || (playerWorld.visitPermission() == IslandPermissions.MEMBERS && !playerWorld.members().contains(target.getUniqueId())))
|
|
||||||
{
|
|
||||||
return messageComponent("cannotAccessIsland");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.teleportAsync(world.getSpawnLocation());
|
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1f, 1f);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
case "settings" ->
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()))
|
|
||||||
{
|
|
||||||
return messageComponent("selfPlayerWorldNotFound");
|
|
||||||
}
|
|
||||||
if (args.length != 3)
|
|
||||||
{
|
|
||||||
return usage("/myworld settings <interact | edit | visit> <nobody | anyone | members>");
|
|
||||||
}
|
|
||||||
if (!args[1].equalsIgnoreCase("interact") && !args[1].equalsIgnoreCase("edit") && !args[1].equalsIgnoreCase("visit"))
|
|
||||||
{
|
|
||||||
return usage("/myworld settings <interact | edit | visit> <nobody | anyone | members>");
|
|
||||||
}
|
|
||||||
final PlayerWorld playerWorld = TFMExtras.getModule().getIslandHandler().loadedIslands().get(player.getUniqueId());
|
|
||||||
try {
|
|
||||||
final IslandPermissions permissions = IslandPermissions.valueOf(args[2].toUpperCase());
|
|
||||||
switch (args[1].toLowerCase())
|
|
||||||
{
|
|
||||||
case "interact" -> playerWorld.interactPermission(permissions);
|
|
||||||
case "edit" -> playerWorld.editPermission(permissions);
|
|
||||||
case "visit" -> playerWorld.visitPermission(permissions);
|
|
||||||
}
|
|
||||||
return messageComponent("islandPermissionUpdated", args[1].toUpperCase(), permissions.name());
|
|
||||||
|
|
||||||
} catch (IllegalArgumentException e)
|
|
||||||
{
|
|
||||||
return usage("/myworld settings <interact | edit | visit> <nobody | anyone | members>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case "invite" -> {
|
|
||||||
final PlexPlayer plexPlayer = DataUtils.getPlayer(args[1], false);
|
|
||||||
if (plexPlayer == null)
|
|
||||||
{
|
|
||||||
throw new PlayerNotFoundException();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()))
|
|
||||||
{
|
|
||||||
return messageComponent("selfPlayerWorldNotFound");
|
|
||||||
}
|
|
||||||
|
|
||||||
final PlayerWorld playerWorld = TFMExtras.getModule().getIslandHandler().loadedIslands().get(player.getUniqueId());
|
|
||||||
if (playerWorld.members().contains(plexPlayer.getPlayer().getUniqueId()))
|
|
||||||
{
|
|
||||||
return messageComponent("islandMemberExists");
|
|
||||||
}
|
|
||||||
playerWorld.pendingInvites().add(plexPlayer.getUuid());
|
|
||||||
if (Bukkit.getPlayer(plexPlayer.getUuid()) != null)
|
|
||||||
{
|
|
||||||
final Player target = Bukkit.getPlayer(plexPlayer.getUuid());
|
|
||||||
assert target != null;
|
|
||||||
target.sendMessage(messageComponent("receivedInviteForIsland", player.getName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return messageComponent("sentInviteToIsland");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
|
||||||
{
|
|
||||||
if (silentCheckPermission(sender, this.getPermission()))
|
|
||||||
{
|
|
||||||
if (args.length == 1)
|
|
||||||
{
|
|
||||||
return Arrays.asList("create", "goto", "manage", "members", "shared", "add", "remove", "settings");
|
|
||||||
}
|
|
||||||
if (args.length == 2)
|
|
||||||
{
|
|
||||||
return PlexUtils.getPlayerNameList();
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package dev.plex.extras.command.slime;
|
|
||||||
|
|
||||||
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.extras.TFMExtras;
|
|
||||||
import dev.plex.util.PlexLog;
|
|
||||||
import dev.plex.util.PlexUtils;
|
|
||||||
import io.papermc.paper.threadedregions.scheduler.ScheduledTask;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
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;
|
|
||||||
|
|
||||||
@CommandParameters(name = "slimemanager", usage = "/<command> <delete | list> [world | all]", description = "Manages the slime worlds handled by the plugin")
|
|
||||||
@CommandPermissions(source = RequiredCommandSource.CONSOLE, permission = "plex.tfmextras.slimemanager")
|
|
||||||
public class SlimeManagerCommand extends PlexCommand
|
|
||||||
{
|
|
||||||
private ScheduledTask task = null;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
|
||||||
{
|
|
||||||
if (args.length == 0)
|
|
||||||
{
|
|
||||||
return usage();
|
|
||||||
}
|
|
||||||
if (!TFMExtras.getModule().enableIslands())
|
|
||||||
{
|
|
||||||
return mmString("<red>SlimeWorldManager is not on this server!");
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (args[0].equalsIgnoreCase("delete"))
|
|
||||||
{
|
|
||||||
if (args.length != 2)
|
|
||||||
{
|
|
||||||
return usage("/slimemanager delete <world | all>");
|
|
||||||
}
|
|
||||||
String argument = args[1];
|
|
||||||
if (TFMExtras.getModule().getSlimeWorldHook().getLoader().listWorlds().isEmpty())
|
|
||||||
{
|
|
||||||
return mmString("<red>There are currently no loaded worlds.");
|
|
||||||
}
|
|
||||||
else if (!argument.equalsIgnoreCase("all") && TFMExtras.getModule().getSlimeWorldHook().getLoader().listWorlds().stream().noneMatch(s -> s.equalsIgnoreCase(argument)))
|
|
||||||
{
|
|
||||||
return mmString("<red>There is no world called " + argument);
|
|
||||||
}
|
|
||||||
if (task != null)
|
|
||||||
{
|
|
||||||
if (argument.equalsIgnoreCase("all"))
|
|
||||||
{
|
|
||||||
TFMExtras.getModule().getSlimeWorldHook().getLoader().listWorlds().forEach(s ->
|
|
||||||
TFMExtras.getModule().getSlimeWorldHook().deleteWorld(s));
|
|
||||||
if (task != null && !task.isCancelled())
|
|
||||||
{
|
|
||||||
task.cancel();
|
|
||||||
task = null;
|
|
||||||
}
|
|
||||||
return mmString("<green>Successfully permanently deleted all slime module loaded worlds!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TFMExtras.getModule().getSlimeWorldHook().deleteWorld(argument);
|
|
||||||
if (task != null && !task.isCancelled())
|
|
||||||
{
|
|
||||||
task.cancel();
|
|
||||||
task = null;
|
|
||||||
}
|
|
||||||
return mmString("<green>Successfully permanently deleted the world <dark_green>" + argument);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
task = Bukkit.getGlobalRegionScheduler().runDelayed(plugin, scheduledTask ->
|
|
||||||
{
|
|
||||||
this.task = null;
|
|
||||||
sender.sendMessage(PlexUtils.mmDeserialize("<red>You did not confirm the deletion in time!"));
|
|
||||||
}, 10 * 20L);
|
|
||||||
return mmString("<green>Run this command again to confirm deletion.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (args[0].equalsIgnoreCase("list"))
|
|
||||||
{
|
|
||||||
return mmString("<blue>Current worlds: <white>" + StringUtils.join(TFMExtras.getModule().getSlimeWorldHook().getLoader().listWorlds(), ", "));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
PlexLog.debug("{0}: {1}", e.getClass().getName(), e.getMessage());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
|
||||||
{
|
|
||||||
if (silentCheckPermission(sender, this.getPermission()))
|
|
||||||
{
|
|
||||||
if (args.length == 1)
|
|
||||||
{
|
|
||||||
return Arrays.asList("delete", "list");
|
|
||||||
}
|
|
||||||
if (args.length == 2)
|
|
||||||
{
|
|
||||||
return TFMExtras.getModule().getSlimeWorldHook().loadedWorlds().stream().toList();
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package dev.plex.extras.hook;
|
|
||||||
|
|
||||||
import dev.plex.extras.TFMExtras;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 2:16 PM [23-08-2023]
|
|
||||||
*/
|
|
||||||
public interface IHook<T>
|
|
||||||
{
|
|
||||||
|
|
||||||
void onEnable(TFMExtras module);
|
|
||||||
|
|
||||||
void onDisable(TFMExtras module);
|
|
||||||
|
|
||||||
T plugin();
|
|
||||||
}
|
|
||||||
@@ -1,261 +0,0 @@
|
|||||||
package dev.plex.extras.hook;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import com.infernalsuite.aswm.api.SlimePlugin;
|
|
||||||
import com.infernalsuite.aswm.api.exceptions.CorruptedWorldException;
|
|
||||||
import com.infernalsuite.aswm.api.exceptions.NewerFormatException;
|
|
||||||
import com.infernalsuite.aswm.api.exceptions.UnknownWorldException;
|
|
||||||
import com.infernalsuite.aswm.api.exceptions.WorldAlreadyExistsException;
|
|
||||||
import com.infernalsuite.aswm.api.exceptions.WorldLockedException;
|
|
||||||
import com.infernalsuite.aswm.api.loaders.SlimeLoader;
|
|
||||||
import com.infernalsuite.aswm.api.world.SlimeWorld;
|
|
||||||
import com.infernalsuite.aswm.api.world.properties.SlimeProperties;
|
|
||||||
import com.infernalsuite.aswm.api.world.properties.SlimePropertyMap;
|
|
||||||
import dev.plex.Plex;
|
|
||||||
import dev.plex.extras.TFMExtras;
|
|
||||||
import dev.plex.extras.island.PlayerWorld;
|
|
||||||
import dev.plex.extras.island.info.IslandPermissions;
|
|
||||||
import dev.plex.util.PlexLog;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.sql.*;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.GameRule;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.event.world.WorldLoadEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 2:19 PM [23-08-2023]
|
|
||||||
*/
|
|
||||||
public class SlimeWorldHook implements IHook<SlimePlugin>
|
|
||||||
{
|
|
||||||
private static final String WORLD_NOT_FOUND = "<red>This world could not be found!";
|
|
||||||
private static final String STORAGE_FAILURE = "<red>This world cannot be stored!";
|
|
||||||
|
|
||||||
private final Set<String> loadedWorlds = Sets.newHashSet();
|
|
||||||
|
|
||||||
// private final List<>
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
private SlimeLoader loader;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable(TFMExtras module)
|
|
||||||
{
|
|
||||||
if (plugin() == null)
|
|
||||||
{
|
|
||||||
PlexLog.error("Cannot find SlimeWorldManager plugin");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PlexLog.log("<green>Enabling SWM Hook");
|
|
||||||
|
|
||||||
this.loader = plugin().getLoader("mysql");
|
|
||||||
this.loadAllWorlds();
|
|
||||||
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
connection.prepareStatement("ALTER TABLE `islands` ADD COLUMN IF NOT EXISTS `interactPermission` VARCHAR(10);").execute();
|
|
||||||
|
|
||||||
} catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
TFMExtras.getModule().getIslandHandler().createTables();
|
|
||||||
TFMExtras.getModule().getIslandHandler().loadIslands();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable(TFMExtras module)
|
|
||||||
{
|
|
||||||
PlexLog.log("<green>Disabling SWM Hook");
|
|
||||||
AtomicInteger i = new AtomicInteger();
|
|
||||||
loadedWorlds.forEach(s ->
|
|
||||||
{
|
|
||||||
final World world = Bukkit.getWorld(s);
|
|
||||||
if (world != null)
|
|
||||||
{
|
|
||||||
Bukkit.unloadWorld(world, true);
|
|
||||||
i.getAndIncrement();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
loadedWorlds.clear();
|
|
||||||
|
|
||||||
CompletableFuture.runAsync(() ->
|
|
||||||
{
|
|
||||||
TFMExtras.getModule().getIslandHandler().loadedIslands().values().forEach(playerWorld -> TFMExtras.getModule().getIslandHandler().updateIsland(playerWorld));
|
|
||||||
TFMExtras.getModule().getIslandHandler().loadedIslands().clear();
|
|
||||||
});
|
|
||||||
PlexLog.log("<green>SWM Hook saved " + i.get() + " worlds");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadAllWorlds()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.loader.listWorlds().forEach(s ->
|
|
||||||
{
|
|
||||||
final SlimePropertyMap slimePropertyMap = new SlimePropertyMap();
|
|
||||||
slimePropertyMap.setValue(SlimeProperties.PVP, false);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SlimeWorld world = this.plugin().loadWorld(this.loader, s, false, slimePropertyMap);
|
|
||||||
this.plugin().loadWorld(world);
|
|
||||||
} catch (UnknownWorldException | WorldLockedException | CorruptedWorldException | NewerFormatException |
|
|
||||||
IllegalArgumentException ex)
|
|
||||||
{
|
|
||||||
PlexLog.error(ex.getMessage());
|
|
||||||
} catch (IOException e)
|
|
||||||
{
|
|
||||||
PlexLog.error(STORAGE_FAILURE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final World world = Bukkit.getWorld(s);
|
|
||||||
if (world == null)
|
|
||||||
{
|
|
||||||
PlexLog.error(WORLD_NOT_FOUND);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
world.setGameRule(GameRule.DO_WEATHER_CYCLE, false);
|
|
||||||
world.setGameRule(GameRule.DISABLE_RAIDS, true);
|
|
||||||
world.setGameRule(GameRule.DO_INSOMNIA, false);
|
|
||||||
world.setGameRule(GameRule.DO_FIRE_TICK, false);
|
|
||||||
world.setSpawnLocation(0, 130, 0);
|
|
||||||
world.setAutoSave(true);
|
|
||||||
|
|
||||||
loadedWorlds.add(s);
|
|
||||||
|
|
||||||
double configuratedSize = TFMExtras.getModule().getConfig().getDouble("player-worlds.size");
|
|
||||||
world.getWorldBorder().setCenter(world.getSpawnLocation());
|
|
||||||
world.getWorldBorder().setSize(configuratedSize == 0 ? 500 : configuratedSize);
|
|
||||||
world.getWorldBorder().setDamageAmount(0);
|
|
||||||
world.getWorldBorder().setDamageBuffer(0);
|
|
||||||
|
|
||||||
Bukkit.getPluginManager().callEvent(new WorldLoadEvent(world));
|
|
||||||
|
|
||||||
PlexLog.debug("Loaded {0}", s);
|
|
||||||
});
|
|
||||||
} catch (IOException | IllegalArgumentException ex)
|
|
||||||
{
|
|
||||||
PlexLog.error(ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isWorldLoaded(String world)
|
|
||||||
{
|
|
||||||
return loadedWorlds.stream().anyMatch(s -> s.equals(world));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteWorld(String world)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (Bukkit.getWorld(world) != null)
|
|
||||||
{
|
|
||||||
Bukkit.unloadWorld(world, false);
|
|
||||||
}
|
|
||||||
this.loader.deleteWorld(world);
|
|
||||||
} catch (UnknownWorldException | IOException e)
|
|
||||||
{
|
|
||||||
PlexLog.error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Pair<World, Boolean> createPlayerWorld(UUID uuid)
|
|
||||||
{
|
|
||||||
final SlimePropertyMap slimePropertyMap = new SlimePropertyMap();
|
|
||||||
slimePropertyMap.setValue(SlimeProperties.PVP, false);
|
|
||||||
|
|
||||||
boolean newWorld = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
slimePropertyMap.setValue(SlimeProperties.SPAWN_X, 0);
|
|
||||||
slimePropertyMap.setValue(SlimeProperties.SPAWN_Y, 130);
|
|
||||||
slimePropertyMap.setValue(SlimeProperties.SPAWN_Z, 0);
|
|
||||||
final SlimeWorld slimeWorld = this.plugin().createEmptyWorld(this.loader, uuid.toString(), false, slimePropertyMap);
|
|
||||||
this.plugin().loadWorld(slimeWorld);
|
|
||||||
newWorld = true;
|
|
||||||
} catch (WorldAlreadyExistsException e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SlimeWorld world = this.plugin().loadWorld(this.loader, uuid.toString(), false, slimePropertyMap);
|
|
||||||
this.plugin().loadWorld(world);
|
|
||||||
} catch (WorldLockedException | CorruptedWorldException | NewerFormatException | UnknownWorldException |
|
|
||||||
IOException | IllegalArgumentException ex)
|
|
||||||
{
|
|
||||||
PlexLog.error(ex.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (IOException e)
|
|
||||||
{
|
|
||||||
PlexLog.error(STORAGE_FAILURE);
|
|
||||||
} catch (WorldLockedException | UnknownWorldException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
final World world = Bukkit.getWorld(uuid.toString());
|
|
||||||
if (world == null)
|
|
||||||
{
|
|
||||||
PlexLog.error(WORLD_NOT_FOUND);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
world.setGameRule(GameRule.DO_WEATHER_CYCLE, false);
|
|
||||||
world.setGameRule(GameRule.DISABLE_RAIDS, true);
|
|
||||||
world.setGameRule(GameRule.DO_INSOMNIA, false);
|
|
||||||
world.setGameRule(GameRule.DO_FIRE_TICK, false);
|
|
||||||
world.setSpawnLocation(0, 130, 0);
|
|
||||||
world.setAutoSave(true);
|
|
||||||
|
|
||||||
if (newWorld)
|
|
||||||
{
|
|
||||||
world.getBlockAt(0, 128, 0).setType(Material.STONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadedWorlds.add(uuid.toString());
|
|
||||||
|
|
||||||
double configuratedSize = TFMExtras.getModule().getConfig().getDouble("player-worlds.size");
|
|
||||||
world.getWorldBorder().setCenter(world.getSpawnLocation());
|
|
||||||
world.getWorldBorder().setSize(configuratedSize == 0 ? 500 : configuratedSize);
|
|
||||||
world.getWorldBorder().setDamageAmount(0);
|
|
||||||
world.getWorldBorder().setDamageBuffer(0);
|
|
||||||
|
|
||||||
final WorldLoadEvent event = new WorldLoadEvent(world);
|
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
final PlayerWorld playerWorld = new PlayerWorld(uuid, Lists.newArrayList(), IslandPermissions.NOBODY, IslandPermissions.ANYONE, IslandPermissions.ANYONE);
|
|
||||||
|
|
||||||
TFMExtras.getModule().getIslandHandler().insertIsland(playerWorld);
|
|
||||||
TFMExtras.getModule().getIslandHandler().loadedIslands().put(uuid, playerWorld);
|
|
||||||
|
|
||||||
return Pair.of(world, newWorld);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> loadedWorlds()
|
|
||||||
{
|
|
||||||
return this.loadedWorlds;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SlimePlugin plugin()
|
|
||||||
{
|
|
||||||
return (SlimePlugin) Bukkit.getPluginManager().getPlugin("SlimeWorldManager");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
package dev.plex.extras.island;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import dev.plex.extras.TFMExtras;
|
|
||||||
import dev.plex.extras.island.info.IslandPermissions;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 9:26 PM [24-08-2023]
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
//@SQLTable("player_worlds")
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(fluent = true)
|
|
||||||
public class PlayerWorld
|
|
||||||
{
|
|
||||||
// @PrimaryKey
|
|
||||||
private final UUID owner;
|
|
||||||
private final List<UUID> members;
|
|
||||||
private final List<UUID> pendingInvites = Lists.newArrayList();
|
|
||||||
|
|
||||||
private IslandPermissions editPermission;
|
|
||||||
private IslandPermissions visitPermission;
|
|
||||||
private IslandPermissions interactPermission;
|
|
||||||
|
|
||||||
|
|
||||||
public boolean addMember(UUID member)
|
|
||||||
{
|
|
||||||
if (members.contains(member))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
CompletableFuture.runAsync(() -> TFMExtras.getModule().getIslandHandler().insertMember(this.owner, member));
|
|
||||||
this.members.add(member);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean removeMember(UUID member)
|
|
||||||
{
|
|
||||||
if (!members.contains(member))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
CompletableFuture.runAsync(() -> TFMExtras.getModule().getIslandHandler().deleteMember(this.owner, member));
|
|
||||||
this.members.remove(member);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package dev.plex.extras.island.info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 10:44 PM [05-01-2024]
|
|
||||||
*/
|
|
||||||
public enum IslandPermissions
|
|
||||||
{
|
|
||||||
ANYONE,
|
|
||||||
NOBODY,
|
|
||||||
MEMBERS
|
|
||||||
}
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
package dev.plex.extras.island.storage;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import dev.plex.Plex;
|
|
||||||
import dev.plex.extras.island.PlayerWorld;
|
|
||||||
import dev.plex.extras.island.info.IslandPermissions;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 10:53 PM [05-01-2024]
|
|
||||||
*/
|
|
||||||
public class IslandHandler
|
|
||||||
{
|
|
||||||
//TODO: Create Table statements
|
|
||||||
private static final String LOAD_ISLANDS = "SELECT * FROM `islands`;";
|
|
||||||
private static final String LOAD_MEMBERS = "SELECT * FROM `island_members`;";
|
|
||||||
private static final String INSERT_ISLAND = "INSERT INTO `islands` (`owner`, `editPermission`, `visitPermission`, `interactPermission`) VALUES(?, ?, ?, ?);";
|
|
||||||
private static final String INSERT_MEMBER = "INSERT INTO `island_members` (`uuid`, `island_owner_uuid`) VALUES(?, ?);";
|
|
||||||
private static final String DELETE_ISLAND = "DELETE FROM `islands` WHERE `owner`=?;";
|
|
||||||
private static final String DELETE_MEMBER = "DELETE FROM `island_members` WHERE `uuid`=? AND `island_owner_uuid`=?;";
|
|
||||||
private static final String UPDATE_ISLAND = "UPDATE `islands` SET `editPermission`=?, `visitPermission`=?, `interactPermission`=? WHERE `owner`=?;";
|
|
||||||
private static final String CREATE_ISLANDS_TABLE = "CREATE TABLE IF NOT EXISTS `islands` (`owner` VARCHAR(36) NOT NULL PRIMARY KEY, `editPermission` VARCHAR(10), `visitPermission` VARCHAR(10), `interactPermission` VARCHAR(10));";
|
|
||||||
private static final String CREATE_MEMBERS_TABLE = "CREATE TABLE IF NOT EXISTS `island_members` (`uuid` VARCHAR(36), `island_owner_uuid` VARCHAR(36));";
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Accessors(fluent = true)
|
|
||||||
private final Map<UUID, PlayerWorld> loadedIslands = Maps.newHashMap();
|
|
||||||
|
|
||||||
public void createTables()
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
connection.prepareStatement(CREATE_ISLANDS_TABLE).execute();
|
|
||||||
connection.prepareStatement(CREATE_MEMBERS_TABLE).execute();
|
|
||||||
} catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void loadIslands()
|
|
||||||
{
|
|
||||||
// Member to Islands Mapping
|
|
||||||
final Map<UUID, List<UUID>> mappedMembers = Maps.newHashMap();
|
|
||||||
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement loadIslands = connection.prepareStatement(LOAD_ISLANDS);
|
|
||||||
final PreparedStatement loadMembers = connection.prepareStatement(LOAD_MEMBERS);
|
|
||||||
|
|
||||||
final ResultSet membersQuery = loadMembers.executeQuery();
|
|
||||||
while (membersQuery.next())
|
|
||||||
{
|
|
||||||
final UUID uuid = UUID.fromString(membersQuery.getString("uuid"));
|
|
||||||
List<UUID> islands = mappedMembers.getOrDefault(uuid, Lists.newArrayList());
|
|
||||||
islands.add(UUID.fromString(membersQuery.getString("island_owner_uuid")));
|
|
||||||
mappedMembers.put(uuid, islands);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
final ResultSet islandsQuery = loadIslands.executeQuery();
|
|
||||||
while (islandsQuery.next())
|
|
||||||
{
|
|
||||||
final UUID owner = UUID.fromString(islandsQuery.getString("owner"));
|
|
||||||
final List<UUID> members = mappedMembers.entrySet().stream().filter(uuiduuidEntry -> uuiduuidEntry.getValue().stream().anyMatch(owners -> owners.equals(owner))).map(Map.Entry::getKey).toList();
|
|
||||||
final IslandPermissions editPerm = IslandPermissions.valueOf(islandsQuery.getString("editPermission").toUpperCase());
|
|
||||||
final IslandPermissions visitPerm = IslandPermissions.valueOf(islandsQuery.getString("visitPermission").toUpperCase());
|
|
||||||
|
|
||||||
final String interactPermission = islandsQuery.getString("interactPermission");
|
|
||||||
|
|
||||||
final IslandPermissions interactPerm = interactPermission == null ? IslandPermissions.NOBODY : IslandPermissions.valueOf(interactPermission.toUpperCase());
|
|
||||||
loadedIslands.put(owner, new PlayerWorld(owner, members, editPerm, visitPerm, interactPerm));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void insertIsland(PlayerWorld world)
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = connection.prepareStatement(INSERT_ISLAND);
|
|
||||||
statement.setString(1, world.owner().toString());
|
|
||||||
statement.setString(2, world.editPermission().name());
|
|
||||||
statement.setString(3, world.visitPermission().name());
|
|
||||||
statement.setString(4, world.interactPermission().name());
|
|
||||||
|
|
||||||
statement.execute();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void insertMember(UUID islandOwner, UUID member)
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = connection.prepareStatement(INSERT_MEMBER);
|
|
||||||
statement.setString(1, member.toString());
|
|
||||||
statement.setString(2, islandOwner.toString());
|
|
||||||
statement.execute();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteMember(UUID islandOwner, UUID member)
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = connection.prepareStatement(DELETE_MEMBER);
|
|
||||||
statement.setString(1, member.toString());
|
|
||||||
statement.setString(2, islandOwner.toString());
|
|
||||||
statement.execute();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteIsland(UUID islandOwner)
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = connection.prepareStatement(DELETE_ISLAND);
|
|
||||||
statement.setString(1, islandOwner.toString());
|
|
||||||
statement.execute();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateIsland(PlayerWorld world)
|
|
||||||
{
|
|
||||||
try (Connection connection = Plex.get().getSqlConnection().getCon())
|
|
||||||
{
|
|
||||||
final PreparedStatement statement = connection.prepareStatement(UPDATE_ISLAND);
|
|
||||||
statement.setString(1, world.editPermission().name());
|
|
||||||
statement.setString(2, world.visitPermission().name());
|
|
||||||
statement.setString(3, world.interactPermission().name());
|
|
||||||
statement.setString(4, world.owner().toString());
|
|
||||||
|
|
||||||
statement.executeUpdate();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -3,11 +3,8 @@ package dev.plex.extras.listener;
|
|||||||
import dev.plex.Plex;
|
import dev.plex.Plex;
|
||||||
import dev.plex.extras.TFMExtras;
|
import dev.plex.extras.TFMExtras;
|
||||||
import dev.plex.listener.PlexListener;
|
import dev.plex.listener.PlexListener;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class PlayerListener extends PlexListener
|
public class PlayerListener extends PlexListener
|
||||||
@@ -39,15 +36,4 @@ public class PlayerListener extends PlexListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void unloadWorld(PlayerQuitEvent event)
|
|
||||||
{
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
// PlexLog.debug("Slime World Loaded: {0}", TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()));
|
|
||||||
// PlexLog.debug("World Loaded: {0}", Bukkit.getWorld(player.getUniqueId().toString()) != null);
|
|
||||||
if (TFMExtras.getModule().enableIslands() && TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(player.getUniqueId().toString()) && Bukkit.getWorld(player.getUniqueId().toString()) != null)
|
|
||||||
{
|
|
||||||
Bukkit.unloadWorld(player.getUniqueId().toString(), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
package dev.plex.extras.listener;
|
|
||||||
|
|
||||||
import dev.plex.extras.TFMExtras;
|
|
||||||
import dev.plex.extras.island.PlayerWorld;
|
|
||||||
import dev.plex.extras.island.info.IslandPermissions;
|
|
||||||
import dev.plex.listener.PlexListener;
|
|
||||||
import dev.plex.util.PlexUtils;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
|
||||||
import org.bukkit.event.player.PlayerChangedWorldEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class WorldListener extends PlexListener
|
|
||||||
{
|
|
||||||
@EventHandler
|
|
||||||
public void onBuild(BlockPlaceEvent event)
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().enableIslands()) return;
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return;
|
|
||||||
final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName());
|
|
||||||
final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner);
|
|
||||||
if (world.owner().equals(event.getPlayer().getUniqueId())) return;
|
|
||||||
if (world.editPermission() == IslandPermissions.NOBODY)
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
event.setBuild(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (world.editPermission() == IslandPermissions.MEMBERS && !world.members().contains(event.getPlayer().getUniqueId()))
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
event.setBuild(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onBreak(BlockBreakEvent event)
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().enableIslands()) return;
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return;
|
|
||||||
final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName());
|
|
||||||
final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner);
|
|
||||||
if (world.owner().equals(event.getPlayer().getUniqueId())) return;
|
|
||||||
if (world.editPermission() == IslandPermissions.NOBODY)
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (world.editPermission() == IslandPermissions.MEMBERS && !world.members().contains(event.getPlayer().getUniqueId()))
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onInteract(PlayerInteractEvent event)
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().enableIslands()) return;
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return;
|
|
||||||
final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName());
|
|
||||||
final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner);
|
|
||||||
if (world.owner().equals(event.getPlayer().getUniqueId())) return;
|
|
||||||
if (world.interactPermission() == IslandPermissions.NOBODY)
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (world.interactPermission() == IslandPermissions.MEMBERS && !world.members().contains(event.getPlayer().getUniqueId()))
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantModifyIsland"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onWorldChange(PlayerChangedWorldEvent event)
|
|
||||||
{
|
|
||||||
if (!TFMExtras.getModule().enableIslands()) return;
|
|
||||||
if (!TFMExtras.getModule().getSlimeWorldHook().isWorldLoaded(event.getPlayer().getWorld().getName())) return;
|
|
||||||
final UUID worldOwner = UUID.fromString(event.getPlayer().getWorld().getName());
|
|
||||||
final PlayerWorld world = TFMExtras.getModule().getIslandHandler().loadedIslands().get(worldOwner);
|
|
||||||
if (world.owner().equals(event.getPlayer().getUniqueId())) return;
|
|
||||||
if (world.visitPermission() == IslandPermissions.NOBODY)
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantVisitIsland"));
|
|
||||||
event.getPlayer().teleportAsync(event.getFrom().getSpawnLocation());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (world.visitPermission() == IslandPermissions.MEMBERS && !world.members().contains(event.getPlayer().getUniqueId()))
|
|
||||||
{
|
|
||||||
event.getPlayer().sendMessage(PlexUtils.messageComponent("cantVisitIsland"));
|
|
||||||
event.getPlayer().teleportAsync(event.getFrom().getSpawnLocation());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,6 +18,4 @@ server:
|
|||||||
toggled_players:
|
toggled_players:
|
||||||
- "9285ace6-7393-45c5-9420-00fc66374ff4"
|
- "9285ace6-7393-45c5-9420-00fc66374ff4"
|
||||||
restricted:
|
restricted:
|
||||||
- "9285ace6-7393-45c5-9420-00fc66374ff4"
|
- "9285ace6-7393-45c5-9420-00fc66374ff4"
|
||||||
player-worlds:
|
|
||||||
size: 500
|
|
||||||
Reference in New Issue
Block a user