This commit is contained in:
Telesphoreo 2021-01-03 01:21:15 -06:00
parent 8ecc1d2fce
commit 5bafa1122c
No known key found for this signature in database
GPG Key ID: 50B67E055A6F167C
91 changed files with 452 additions and 460 deletions

View File

@ -1,2 +1,2 @@
# Plex
The long awaited rewrite of TotalFreedomMod begins here...
A new freedom plugin.

10
pom.xml
View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.totalfreedom</groupId>
<groupId>dev.plex</groupId>
<artifactId>Plex</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
@ -41,7 +41,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
<version>20201115</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -56,19 +56,19 @@
<dependency>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia-core</artifactId>
<version>2.0.2</version>
<version>2.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.6.2</version>
<version>2.7.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -1,24 +1,24 @@
package me.totalfreedom.plex;
package dev.plex;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.plex.admin.AdminList;
import me.totalfreedom.plex.banning.BanManager;
import me.totalfreedom.plex.cache.MongoPlayerData;
import me.totalfreedom.plex.cache.SQLPlayerData;
import me.totalfreedom.plex.config.Config;
import me.totalfreedom.plex.handlers.CommandHandler;
import me.totalfreedom.plex.handlers.ListenerHandler;
import me.totalfreedom.plex.punishment.PunishmentManager;
import me.totalfreedom.plex.rank.RankManager;
import me.totalfreedom.plex.services.ServiceManager;
import me.totalfreedom.plex.storage.MongoConnection;
import me.totalfreedom.plex.storage.RedisConnection;
import me.totalfreedom.plex.storage.SQLConnection;
import me.totalfreedom.plex.storage.StorageType;
import me.totalfreedom.plex.util.PlexLog;
import me.totalfreedom.plex.util.PlexUtils;
import me.totalfreedom.plex.world.CustomWorld;
import dev.plex.admin.AdminList;
import dev.plex.banning.BanManager;
import dev.plex.cache.MongoPlayerData;
import dev.plex.cache.SQLPlayerData;
import dev.plex.config.Config;
import dev.plex.handlers.CommandHandler;
import dev.plex.handlers.ListenerHandler;
import dev.plex.punishment.PunishmentManager;
import dev.plex.rank.RankManager;
import dev.plex.services.ServiceManager;
import dev.plex.storage.MongoConnection;
import dev.plex.storage.RedisConnection;
import dev.plex.storage.SQLConnection;
import dev.plex.storage.StorageType;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
import dev.plex.world.CustomWorld;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
@ -87,7 +87,7 @@ public class Plex extends JavaPlugin
e.printStackTrace();
}
if (storageType == StorageType.MONGO)
if (storageType == StorageType.MONGODB)
{
mongoPlayerData = new MongoPlayerData();
}

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex;
package dev.plex;
public class PlexBase
{

View File

@ -1,10 +1,10 @@
package me.totalfreedom.plex.admin;
package dev.plex.admin;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.rank.enums.Rank;
@Getter
@Setter

View File

@ -1,10 +1,12 @@
package me.totalfreedom.plex.admin;
package dev.plex.admin;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import dev.morphia.Datastore;
import dev.morphia.query.Query;
import dev.morphia.query.internal.MorphiaCursor;
import dev.plex.Plex;
import dev.plex.player.PlexPlayer;
import dev.plex.storage.StorageType;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@ -12,10 +14,7 @@ import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.storage.StorageType;
import dev.plex.rank.enums.Rank;
public class AdminList
{
@ -36,14 +35,12 @@ public class AdminList
public List<String> getAllAdmins()
{
List<String> admins = Lists.newArrayList();
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Datastore store = Plex.get().getMongoConnection().getDatastore();
Query<PlexPlayer> query = store.find(PlexPlayer.class);
MorphiaCursor<PlexPlayer> cursor = query.iterator();
while (cursor.hasNext())
for (PlexPlayer player : query)
{
PlexPlayer player = cursor.next();
if (player.getRankFromString().isAtLeast(Rank.ADMIN))
{
admins.add(player.getName());

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.banning;
package dev.plex.banning;
import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;
@ -17,6 +17,9 @@ import java.util.UUID;
@Entity(value = "bans", useDiscriminator = false)
public class Ban
{
public Ban()
{
}
@Setter(AccessLevel.NONE)
@Id
@ -24,7 +27,7 @@ public class Ban
@Setter(AccessLevel.NONE)
@Indexed(options = @IndexOptions(unique = true))
private final UUID uuid;
private UUID uuid;
@Indexed // have the banner be indexed in the future to get bans issued by a person
private UUID banner;
@ -33,6 +36,7 @@ public class Ban
private String reason;
private Date endDate;
private boolean active;
public Ban(UUID uuid, UUID banner, String ip, String reason, Date endDate)
{
this.uuid = uuid;
@ -54,6 +58,4 @@ public class Ban
this.endDate = endDate;
this.active = true;
}
}

View File

@ -1,13 +1,12 @@
package me.totalfreedom.plex.banning;
package dev.plex.banning;
import com.google.common.collect.Lists;
import dev.morphia.query.Query;
import dev.morphia.query.experimental.filters.Filters;
import dev.morphia.query.experimental.updates.UpdateOperators;
import dev.morphia.query.internal.MorphiaCursor;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.storage.StorageType;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.Plex;
import dev.plex.storage.StorageType;
import java.sql.Connection;
import java.sql.PreparedStatement;
@ -24,7 +23,7 @@ public class BanManager
public void executeBan(Ban ban)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Plex.get().getMongoConnection().getDatastore().save(ban);
} else {
@ -49,7 +48,7 @@ public class BanManager
public boolean isBanned(UUID uuid)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
return Plex.get().getMongoConnection().getDatastore().find(Ban.class)
.filter(Filters.eq("uuid", uuid.toString())).filter(Filters.eq("active", true)).first() != null;
@ -73,7 +72,7 @@ public class BanManager
public void unban(UUID uuid)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Query<Ban> query = Plex.get().getMongoConnection().getDatastore().find(Ban.class).filter(Filters.eq("uuid", uuid.toString())).filter(Filters.eq("active", true));
if (query.first() != null)
@ -95,7 +94,7 @@ public class BanManager
public void unban(String id)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Query<Ban> query = Plex.get().getMongoConnection().getDatastore().find(Ban.class).filter(Filters.eq("_id", id)).filter(Filters.eq("active", true));
if (query.first() != null)
@ -118,7 +117,7 @@ public class BanManager
public List<Ban> getActiveBans()
{
List<Ban> bans = Lists.newArrayList();
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
MorphiaCursor<Ban> cursor = Plex.get().getMongoConnection().getDatastore().find(Ban.class).filter(Filters.eq("active", true)).iterator();
while (cursor.hasNext())

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.cache;
package dev.plex.cache;
import dev.plex.Plex;
import dev.plex.player.PlexPlayer;
import dev.plex.storage.StorageType;
import java.util.UUID;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.storage.StorageType;
import org.bukkit.Bukkit;
public class DataUtils
@ -12,7 +12,7 @@ public class DataUtils
public static boolean hasPlayedBefore(UUID uuid)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
return Plex.get().getMongoPlayerData().exists(uuid);
}
@ -29,7 +29,7 @@ public class DataUtils
return PlayerCache.getPlexPlayerMap().get(uuid);
}
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
return Plex.get().getMongoPlayerData().getByUUID(uuid);
}
@ -46,7 +46,7 @@ public class DataUtils
public static void update(PlexPlayer plexPlayer)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Plex.get().getMongoPlayerData().update(plexPlayer);
}
@ -58,7 +58,7 @@ public class DataUtils
public static void insert(PlexPlayer plexPlayer)
{
if (Plex.get().getStorageType() == StorageType.MONGO)
if (Plex.get().getStorageType() == StorageType.MONGODB)
{
Plex.get().getMongoPlayerData().save(plexPlayer);
} else {

View File

@ -1,13 +1,13 @@
package me.totalfreedom.plex.cache;
package dev.plex.cache;
import dev.morphia.Datastore;
import dev.morphia.query.Query;
import dev.morphia.query.Update;
import dev.morphia.query.experimental.filters.Filters;
import dev.morphia.query.experimental.updates.UpdateOperators;
import dev.plex.Plex;
import dev.plex.player.PlexPlayer;
import java.util.UUID;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.player.PlexPlayer;
public class MongoPlayerData
{

View File

@ -1,10 +1,10 @@
package me.totalfreedom.plex.cache;
package dev.plex.cache;
import com.google.common.collect.Maps;
import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer;
import java.util.Map;
import java.util.UUID;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.player.PunishedPlayer;
public class PlayerCache
{

View File

@ -1,15 +1,15 @@
package me.totalfreedom.plex.cache;
package dev.plex.cache;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import dev.plex.Plex;
import dev.plex.player.PlexPlayer;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.player.PlexPlayer;
public class SQLPlayerData
{

View File

@ -1,8 +1,7 @@
package me.totalfreedom.plex.command;
package dev.plex.command;
import dev.plex.command.source.CommandSource;
import java.util.List;
import me.totalfreedom.plex.command.source.CommandSource;
import org.bukkit.command.CommandSender;
public interface IPlexCommand
{

View File

@ -1,23 +1,22 @@
package me.totalfreedom.plex.command;
package dev.plex.command;
import com.google.common.collect.ImmutableList;
import dev.plex.Plex;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.exception.PlayerNotFoundException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexLog;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.command.annotation;
package dev.plex.command.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.command.annotation;
package dev.plex.command.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
@Retention(RetentionPolicy.RUNTIME)
public @interface CommandPermissions

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.command.exception;
package dev.plex.command.exception;
public class CommandArgumentException extends RuntimeException
{

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.command.exception;
package dev.plex.command.exception;
public class CommandFailException extends RuntimeException // this is literally just a runtime exception lol
{

View File

@ -1,6 +1,6 @@
package me.totalfreedom.plex.command.exception;
package dev.plex.command.exception;
import static me.totalfreedom.plex.util.PlexUtils.tl;
import static dev.plex.util.PlexUtils.tl;
public class ConsoleMustDefinePlayerException extends RuntimeException
{

View File

@ -1,6 +1,6 @@
package me.totalfreedom.plex.command.exception;
package dev.plex.command.exception;
import static me.totalfreedom.plex.util.PlexUtils.tl;
import static dev.plex.util.PlexUtils.tl;
public class PlayerNotFoundException extends RuntimeException
{

View File

@ -1,22 +1,22 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.PlayerNotFoundException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.event.AdminAddEvent;
import me.totalfreedom.plex.event.AdminRemoveEvent;
import me.totalfreedom.plex.event.AdminSetRankEvent;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.cache.DataUtils;
import dev.plex.command.PlexCommand;
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 org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;

View File

@ -1,17 +1,16 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import java.util.Collections;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;

View File

@ -1,24 +1,21 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.banning.Ban;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.PlayerNotFoundException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.punishment.Punishment;
import me.totalfreedom.plex.punishment.PunishmentType;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.punishment.Punishment;
import dev.plex.punishment.PunishmentType;
import dev.plex.cache.DataUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import java.time.Instant;
import java.util.Date;

View File

@ -1,17 +1,16 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import java.util.Collections;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;

View File

@ -1,22 +1,22 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.util.PlexUtils;
import me.totalfreedom.plex.world.BlockMapChunkGenerator;
import me.totalfreedom.plex.world.CustomWorld;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.util.PlexUtils;
import dev.plex.world.BlockMapChunkGenerator;
import dev.plex.world.CustomWorld;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;

View File

@ -1,23 +1,23 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource;
import dev.plex.punishment.Punishment;
import dev.plex.punishment.PunishmentType;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.punishment.Punishment;
import me.totalfreedom.plex.punishment.PunishmentType;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.cache.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.player.PunishedPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
@CommandParameters(description = "Freeze a player on the server", usage = "/<command> <player>")

View File

@ -1,17 +1,17 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;

View File

@ -1,13 +1,13 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

View File

@ -1,14 +1,14 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
@CommandParameters(description = "Op a player on the server", usage = "/<command> <player>")

View File

@ -1,13 +1,13 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "plexhelp", description = "Help with plex")

View File

@ -1,14 +1,14 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.menu.PunishmentMenu;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.command.PlexCommand;
import dev.plex.menu.PunishmentMenu;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.entity.Player;
import java.util.List;

View File

@ -1,17 +1,16 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import java.util.Collections;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;

View File

@ -1,17 +1,16 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import java.util.Collections;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandFailException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.List;
import com.google.common.collect.ImmutableList;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandFailException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;

View File

@ -1,14 +1,14 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.Arrays;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(aliases = "tst,tast", description = "HELLO")

View File

@ -1,15 +1,15 @@
package me.totalfreedom.plex.command.impl;
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.exception.CommandArgumentException;
import dev.plex.command.source.CommandSource;
import dev.plex.command.source.RequiredCommandSource;
import java.util.ArrayList;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions;
import me.totalfreedom.plex.command.exception.CommandArgumentException;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.command.PlexCommand;
import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;

View File

@ -1,8 +1,8 @@
package me.totalfreedom.plex.command.source;
package dev.plex.command.source;
import lombok.Getter;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.player.PlexPlayer;
import dev.plex.cache.PlayerCache;
import dev.plex.player.PlexPlayer;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.command.source;
package dev.plex.command.source;
public enum RequiredCommandSource
{

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.config;
package dev.plex.config;
import dev.plex.Plex;
import java.io.File;
import me.totalfreedom.plex.Plex;
import org.bukkit.configuration.file.YamlConfiguration;
public class Config extends YamlConfiguration

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.player.PlexPlayer;
import dev.plex.command.source.CommandSource;
import dev.plex.player.PlexPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.player.PlexPlayer;
import dev.plex.command.source.CommandSource;
import dev.plex.player.PlexPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

View File

@ -1,8 +1,8 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import me.totalfreedom.plex.command.source.CommandSource;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.command.source.CommandSource;
import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import dev.plex.player.PunishedPlayer;
import java.util.UUID;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.plex.player.PunishedPlayer;
import org.bukkit.Bukkit;
import org.bukkit.event.Cancellable;
import org.bukkit.event.player.PlayerEvent;

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import dev.plex.player.PunishedPlayer;
import lombok.Getter;
import me.totalfreedom.plex.player.PunishedPlayer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.event;
package dev.plex.event;
import dev.plex.player.PunishedPlayer;
import lombok.Getter;
import me.totalfreedom.plex.player.PunishedPlayer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;

View File

@ -1,10 +1,24 @@
package me.totalfreedom.plex.handlers;
package dev.plex.handlers;
import com.google.common.collect.Lists;
import dev.plex.command.impl.AdminCMD;
import dev.plex.command.impl.AdventureCMD;
import dev.plex.command.impl.BanCMD;
import dev.plex.command.impl.CreativeCMD;
import dev.plex.command.impl.FionnCMD;
import dev.plex.command.impl.FreezeCMD;
import dev.plex.command.impl.NameHistoryCMD;
import dev.plex.command.impl.OpAllCMD;
import dev.plex.command.impl.OpCMD;
import dev.plex.command.impl.PlexCMD;
import dev.plex.command.impl.PunishmentsCMD;
import dev.plex.command.impl.SpectatorCMD;
import dev.plex.command.impl.SurvivalCMD;
import dev.plex.command.impl.TestCMD;
import dev.plex.command.impl.WorldCMD;
import java.util.List;
import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.impl.*;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.command.PlexCommand;
import dev.plex.util.PlexLog;
public class CommandHandler
{

View File

@ -1,15 +1,20 @@
package me.totalfreedom.plex.handlers;
package dev.plex.handlers;
import com.google.common.collect.Lists;
import dev.plex.listener.impl.AdminListener;
import dev.plex.listener.impl.ChatListener;
import dev.plex.listener.impl.FreezeListener;
import dev.plex.listener.impl.LoginListener;
import dev.plex.listener.impl.PlayerListener;
import dev.plex.listener.impl.ServerListener;
import dev.plex.listener.impl.WorldListener;
import java.util.List;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.listener.impl.*;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexLog;
public class ListenerHandler
{
private List<PlexListener> listeners = Lists.newArrayList();
List<PlexListener> listeners = Lists.newArrayList();
public ListenerHandler()
{
listeners.add(new ServerListener());

View File

@ -1,6 +1,6 @@
package me.totalfreedom.plex.listener;
package dev.plex.listener;
import me.totalfreedom.plex.PlexBase;
import dev.plex.PlexBase;
import org.bukkit.event.Listener;
public abstract class PlexListener extends PlexBase implements Listener

View File

@ -0,0 +1,42 @@
package dev.plex.listener.impl;
import dev.plex.event.AdminAddEvent;
import dev.plex.event.AdminRemoveEvent;
import dev.plex.event.AdminSetRankEvent;
import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import static dev.plex.util.PlexUtils.tl;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
public class AdminListener extends PlexListener
{
@EventHandler
public void onAdminAdd(AdminAddEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Bukkit.broadcastMessage(tl("newAdminAdded", userSender, target.getName()));
}
@EventHandler
public void onAdminRemove(AdminRemoveEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Bukkit.broadcastMessage(tl("adminRemoved", userSender, target.getName()));
}
@EventHandler
public void onAdminSetRank(AdminSetRankEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Rank newRank = event.getRank();
Bukkit.broadcastMessage(tl("adminSetRank", userSender, target.getName(), newRank.name().toUpperCase()));
}
}

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.player.PlexPlayer;
import dev.plex.Plex;
import dev.plex.cache.PlayerCache;
import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerChatEvent;

View File

@ -1,17 +1,11 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.event.PunishedPlayerFreezeEvent;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import dev.plex.cache.PlayerCache;
import dev.plex.listener.PlexListener;
import dev.plex.player.PunishedPlayer;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import java.util.UUID;
public class FreezeListener extends PlexListener
{
@EventHandler

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexLog;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
@ -16,7 +16,7 @@ public class LoginListener extends PlexListener
PlexLog.log(String.valueOf(plugin.getBanManager().isBanned(event.getUniqueId())));
if (plugin.getBanManager().isBanned(event.getUniqueId()))
{
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "§cYou're currently banned from this server.\n§cPlease appeal at §6https://forum.totalfreedom.me/");
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "§cYou're currently banned from this server.\n§cPlease appeal at §6https://forums.telesphoreo.me");
}
}

View File

@ -1,21 +1,17 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import java.time.Instant;
import java.util.Arrays;
import java.util.Date;
import java.util.UUID;
import me.totalfreedom.plex.admin.Admin;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.cache.MongoPlayerData;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.cache.SQLPlayerData;
import me.totalfreedom.plex.command.impl.FionnCMD;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.punishment.Punishment;
import me.totalfreedom.plex.punishment.PunishmentType;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.admin.Admin;
import dev.plex.cache.DataUtils;
import dev.plex.cache.MongoPlayerData;
import dev.plex.cache.PlayerCache;
import dev.plex.cache.SQLPlayerData;
import dev.plex.command.impl.FionnCMD;
import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer;
import dev.plex.util.PlexLog;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexUtils;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.server.ServerListPingEvent;

View File

@ -1,16 +1,16 @@
package me.totalfreedom.plex.listener.impl;
package dev.plex.listener.impl;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.cache.PlayerCache;
import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import static me.totalfreedom.plex.util.PlexUtils.tl;
import static dev.plex.util.PlexUtils.tl;
public class WorldListener extends PlexListener
{

View File

@ -1,10 +1,10 @@
package me.totalfreedom.plex.menu;
package dev.plex.menu;
import com.google.common.collect.Lists;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.punishment.Punishment;
import me.totalfreedom.plex.util.menu.AbstractMenu;
import dev.plex.cache.PlayerCache;
import dev.plex.player.PunishedPlayer;
import dev.plex.punishment.Punishment;
import dev.plex.util.menu.AbstractMenu;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -22,10 +22,9 @@ import java.util.List;
public class PunishedPlayerMenu extends AbstractMenu
{
private final PunishedPlayer punishedPlayer;
private PunishedPlayer punishedPlayer;
private List<Inventory> inventories = Lists.newArrayList();
private final List<Inventory> inventories = Lists.newArrayList();
public PunishedPlayerMenu(PunishedPlayer player) {
super("§c§lPunishments");

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.menu;
package dev.plex.menu;
import com.google.common.collect.Lists;
import me.totalfreedom.plex.cache.PlayerCache;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.util.menu.AbstractMenu;
import dev.plex.cache.PlayerCache;
import dev.plex.player.PunishedPlayer;
import dev.plex.util.menu.AbstractMenu;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.player;
package dev.plex.player;
import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;
@ -10,7 +10,7 @@ import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.plex.rank.enums.Rank;
import dev.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;

View File

@ -1,5 +1,7 @@
package me.totalfreedom.plex.player;
package dev.plex.player;
import dev.plex.Plex;
import dev.plex.punishment.Punishment;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -12,12 +14,8 @@ import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.event.PunishedPlayerFreezeEvent;
import me.totalfreedom.plex.event.PunishedPlayerMuteEvent;
import me.totalfreedom.plex.punishment.Punishment;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.event.PunishedPlayerFreezeEvent;
import dev.plex.event.PunishedPlayerMuteEvent;
import org.apache.commons.io.FileUtils;
import org.bukkit.Bukkit;
import org.json.JSONObject;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.punishment;
package dev.plex.punishment;
import com.google.common.collect.Lists;
import com.google.gson.Gson;

View File

@ -1,16 +1,12 @@
package me.totalfreedom.plex.punishment;
package dev.plex.punishment;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.banning.Ban;
import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.event.PunishedPlayerFreezeEvent;
import me.totalfreedom.plex.player.PunishedPlayer;
import me.totalfreedom.plex.util.PlexLog;
import me.totalfreedom.plex.util.PlexUtils;
import dev.plex.Plex;
import dev.plex.banning.Ban;
import dev.plex.player.PunishedPlayer;
import dev.plex.util.PlexUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.time.DateUtils;
import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitRunnable;
import org.json.JSONObject;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.punishment;
package dev.plex.punishment;
public enum PunishmentType
{

View File

@ -1,9 +1,9 @@
package me.totalfreedom.plex.rank;
package dev.plex.rank;
import com.google.common.collect.Lists;
import dev.plex.rank.enums.Rank;
import java.util.List;
import lombok.Getter;
import me.totalfreedom.plex.rank.enums.Rank;
@Getter
public class DefaultRankObj

View File

@ -1,16 +1,16 @@
package me.totalfreedom.plex.rank;
package dev.plex.rank;
import com.google.common.collect.Maps;
import dev.plex.Plex;
import dev.plex.player.PlexPlayer;
import dev.plex.util.PlexLog;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;
import java.util.stream.Collectors;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import me.totalfreedom.plex.util.PlexLog;
import dev.plex.rank.enums.Rank;
import org.json.JSONObject;
import org.json.JSONTokener;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.rank.enums;
package dev.plex.rank.enums;
import com.google.common.collect.Lists;
import java.util.List;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.rank.enums;
package dev.plex.rank.enums;
import org.bukkit.ChatColor;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.services;
package dev.plex.services;
public abstract class AbstractService implements IService
{

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.services;
package dev.plex.services;
public interface IService
{

View File

@ -1,8 +1,8 @@
package me.totalfreedom.plex.services;
package dev.plex.services;
import com.google.common.collect.Lists;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.services.impl.BanService;
import dev.plex.Plex;
import dev.plex.services.impl.BanService;
import org.bukkit.Bukkit;
import java.util.List;

View File

@ -1,8 +1,8 @@
package me.totalfreedom.plex.services.impl;
package dev.plex.services.impl;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.banning.Ban;
import me.totalfreedom.plex.services.AbstractService;
import dev.plex.Plex;
import dev.plex.services.AbstractService;
import dev.plex.banning.Ban;
import org.bukkit.Bukkit;
import java.util.Date;

View File

@ -1,13 +1,13 @@
package me.totalfreedom.plex.storage;
package dev.plex.storage;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import dev.morphia.Datastore;
import dev.morphia.Morphia;
import dev.morphia.mapping.MapperOptions;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.banning.Ban;
import me.totalfreedom.plex.player.PlexPlayer;
import dev.plex.Plex;
import dev.plex.banning.Ban;
import dev.plex.player.PlexPlayer;
public class MongoConnection
{
@ -33,7 +33,7 @@ public class MongoConnection
datastore.getMapper().map(PlexPlayer.class);
datastore.getMapper().map(Ban.class);
datastore.ensureIndexes();
plugin.setStorageType(StorageType.MONGO);
plugin.setStorageType(StorageType.MONGODB);
return datastore;
}
}

View File

@ -1,6 +1,6 @@
package me.totalfreedom.plex.storage;
package dev.plex.storage;
import me.totalfreedom.plex.Plex;
import dev.plex.Plex;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

View File

@ -1,11 +1,11 @@
package me.totalfreedom.plex.storage;
package dev.plex.storage;
import dev.plex.Plex;
import dev.plex.PlexBase;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.PlexBase;
public class SQLConnection extends PlexBase
{
@ -29,7 +29,7 @@ public class SQLConnection extends PlexBase
{
Class.forName("org.mariadb.jdbc.Driver");
connection = DriverManager.getConnection("jdbc:mariadb://" + host + ":" + port + "/" + database, username, password);
Plex.get().setStorageType(StorageType.SQL);
Plex.get().setStorageType(StorageType.MARIADB);
}
}
catch (SQLException | ClassNotFoundException throwables)

View File

@ -0,0 +1,6 @@
package dev.plex.storage;
public enum StorageType
{
MONGODB, MARIADB, SQLITE
}

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.util;
package dev.plex.util;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;

View File

@ -1,5 +1,8 @@
package me.totalfreedom.plex.util;
package dev.plex.util;
import dev.plex.Plex;
import dev.plex.config.Config;
import dev.plex.storage.StorageType;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -9,9 +12,6 @@ import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
import me.totalfreedom.plex.Plex;
import me.totalfreedom.plex.config.Config;
import me.totalfreedom.plex.storage.StorageType;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -51,7 +51,7 @@ public class PlexUtils
{
if (Plex.get().getSqlConnection().getCon() != null)
{
if (Plex.get().getStorageType() == StorageType.SQL)
if (Plex.get().getStorageType() == StorageType.MARIADB)
{
PlexLog.log("Successfully enabled MySQL!");
}

View File

@ -1,6 +1,6 @@
package me.totalfreedom.plex.util.menu;
package dev.plex.util.menu;
import me.totalfreedom.plex.Plex;
import dev.plex.Plex;
import org.bukkit.event.Listener;
public abstract class AbstractMenu implements Listener

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.util.menu;
package dev.plex.util.menu;
import org.bukkit.entity.Player;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import java.util.LinkedHashMap;
import java.util.Map;

View File

@ -1,7 +1,7 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import dev.plex.Plex;
import java.util.LinkedHashMap;
import me.totalfreedom.plex.Plex;
import org.bukkit.Material;
import org.bukkit.generator.BlockPopulator;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import java.util.Arrays;
import java.util.List;

View File

@ -1,8 +1,8 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import dev.plex.Plex;
import java.io.File;
import java.util.Objects;
import me.totalfreedom.plex.Plex;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.WorldCreator;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import java.util.Random;
import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import java.util.Random;
import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import lombok.Getter;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import java.util.Random;
import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package me.totalfreedom.plex.world;
package dev.plex.world;
import lombok.Getter;

View File

@ -1,44 +0,0 @@
package me.totalfreedom.plex.listener.impl;
import me.totalfreedom.plex.event.AdminAddEvent;
import me.totalfreedom.plex.event.AdminRemoveEvent;
import me.totalfreedom.plex.event.AdminSetRankEvent;
import me.totalfreedom.plex.listener.PlexListener;
import me.totalfreedom.plex.player.PlexPlayer;
import me.totalfreedom.plex.rank.enums.Rank;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
public class AdminListener extends PlexListener
{
@EventHandler
public void onAdminAdd(AdminAddEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Adding %s to the admin list!", userSender, target.getName()));
}
@EventHandler
public void onAdminRemove(AdminRemoveEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Removing %s from the admin list!", userSender, target.getName()));
}
@EventHandler
public void onAdminSetrank(AdminSetRankEvent event)
{
String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer();
Rank newRank = event.getRank();
Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Setting %s's rank to %s!", userSender, target.getName(), newRank.name().toUpperCase()));
}
}

View File

@ -1,6 +0,0 @@
package me.totalfreedom.plex.storage;
public enum StorageType
{
MONGO, SQL, SQLITE
}

View File

@ -1,19 +1,19 @@
# Plex Configuration File
server:
name: "TotalFreedom"
name: "ExampleFreedom"
motd: "%servername% - Minecraft %mcversion%"
colorize_motd: true
data:
central:
storage: sqlite # use mariadb, mongodb, or sqlite here
storage: sqlite # Use mariadb, mongodb, or sqlite here
user: ""
password: ""
hostname: 127.0.0.1
port: 27017
db: "plex"
side: # This is redis, leave password blank if auth is false
side: # This is Redis, leave password blank if auth is false
auth: true
hostname: 127.0.0.1
port: 6379

View File

@ -54,4 +54,7 @@ nameHistoryFail: <e>Something went wrong while trying to retrieve name history o
gameModeSetTo: Your gamemode has been set to <v>.
setOtherPlayerGameModeTo: You set <v>'s gamemode to <v>.
playerSetOtherGameMode: <v> set your gamemode to <v>.
consoleMustDefinePlayer: You must define a player since you are running this command from console.
consoleMustDefinePlayer: You must define a player since you are running this command from console.
newAdminAdded: <b><v> - Adding <v> to the admin list
adminRemoved: <c><v> - Removing <v> from the admin list
adminSetRank: <b><v> - Setting <v>'s rank to <v>

View File

@ -1,5 +1,5 @@
name: ${project.name}
version: ${project.version}
author: Telesphoreo
main: me.totalfreedom.plex.Plex
authors: [Telesphoreo, taahanis, super]
main: dev.plex.Plex
api-version: 1.16