Begin SQL Storage

Remove mavenLocal for finding Plex
This commit is contained in:
Taah
2024-05-02 00:25:31 -07:00
parent 42009275eb
commit a2f63a54d3
8 changed files with 251 additions and 26 deletions
@@ -6,6 +6,8 @@ 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.util.PlexUtils;
import java.util.Arrays;
import java.util.Collections;
@@ -73,6 +75,14 @@ public class MyWorldCommand extends PlexCommand
{
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;