mirror of
https://github.com/Freezy-Studios/BlazeSMP.git
synced 2025-04-21 21:14:04 +02:00
Added ClanCommand and implemented tabcompletor
This commit is contained in:
parent
a1a6f21624
commit
8bc458c468
8 changed files with 351 additions and 14 deletions
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="ASK" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -1,6 +1,7 @@
|
||||||
package me.freezy.plugins.papermc.blazesmp;
|
package me.freezy.plugins.papermc.blazesmp;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.command.ClanCommand;
|
||||||
import me.freezy.plugins.papermc.blazesmp.module.manager.Clans;
|
import me.freezy.plugins.papermc.blazesmp.module.manager.Clans;
|
||||||
import me.freezy.plugins.papermc.blazesmp.module.manager.Homes;
|
import me.freezy.plugins.papermc.blazesmp.module.manager.Homes;
|
||||||
import me.freezy.plugins.papermc.blazesmp.module.manager.ProtectedBlocks;
|
import me.freezy.plugins.papermc.blazesmp.module.manager.ProtectedBlocks;
|
||||||
|
@ -46,6 +47,9 @@ public final class BlazeSMP extends JavaPlugin {
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
BlazeSMP.instance=this;
|
BlazeSMP.instance=this;
|
||||||
|
|
||||||
|
this.log.info("Registering Commands...");
|
||||||
|
new ClanCommand().register();
|
||||||
|
this.log.info("Registered Commands!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,158 @@
|
||||||
|
package me.freezy.plugins.papermc.blazesmp.command;
|
||||||
|
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.BlazeSMP;
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.command.util.SimpleCommand;
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.module.Clan;
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.module.manager.Clans;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
public class ClanCommand extends SimpleCommand {
|
||||||
|
private final BlazeSMP plugin;
|
||||||
|
private final Clans clans;
|
||||||
|
|
||||||
|
private final LinkedHashMap<Clan, LinkedList<UUID>> clanInvites = new LinkedHashMap<>();
|
||||||
|
private final LinkedHashMap<Clan, LinkedList<UUID>> clanJoins = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
public ClanCommand() {
|
||||||
|
super("clan");
|
||||||
|
plugin = BlazeSMP.getInstance();
|
||||||
|
clans = plugin.getClans();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String list, @NotNull String[] args) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String list, @NotNull String[] args) {
|
||||||
|
Player player = (Player) sender;
|
||||||
|
UUID playerUUID = player.getUniqueId();
|
||||||
|
if (args.length == 1) {
|
||||||
|
if (clans.isLeader(playerUUID)) {
|
||||||
|
return Stream.of("info", "invite", "kick", "transfer", "promote", "demote", "disband", "leave", "accept", "deny", "modify")
|
||||||
|
.filter(s -> s.startsWith(args[0]))
|
||||||
|
.toList();
|
||||||
|
} else if (clans.isVice(playerUUID)) {
|
||||||
|
return Stream.of("info", "invite", "kick", "demote", "leave", "accept", "deny")
|
||||||
|
.filter(s -> s.startsWith(args[0]))
|
||||||
|
.toList();
|
||||||
|
} else if (clans.isMember(playerUUID)) {
|
||||||
|
return Stream.of("info","leave")
|
||||||
|
.filter(s -> s.startsWith(args[0]))
|
||||||
|
.toList();
|
||||||
|
} else {
|
||||||
|
return Stream.of("create", "join", "accept", "deny")
|
||||||
|
.filter(s -> s.startsWith(args[0]))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
} else if (args.length == 2) {
|
||||||
|
if (clans.isLeader(playerUUID)) {
|
||||||
|
if (args[0].equalsIgnoreCase("invite")) {
|
||||||
|
return Bukkit.getOnlinePlayers().stream()
|
||||||
|
.filter(p -> !clans.isMember(p.getUniqueId()))
|
||||||
|
.map(Player::getName)
|
||||||
|
.filter(name -> name.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("kick")) {
|
||||||
|
return clans.getClanByMember(playerUUID).getMembers().stream()
|
||||||
|
.map(UUID::toString)
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("promote")) {
|
||||||
|
return clans.getClanByMember(playerUUID).getMembers().stream()
|
||||||
|
.map(UUID::toString)
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("demote")) {
|
||||||
|
return Collections.singletonList(plugin.getServer().getOfflinePlayer(clans.getClanByMember(playerUUID).getViceUUID()).getName());
|
||||||
|
} else if (args[0].equalsIgnoreCase("accept")) {
|
||||||
|
List<String> joins = getClanJoinRequests(args, playerUUID);
|
||||||
|
if (joins != null) return joins;
|
||||||
|
} else if (args[0].equalsIgnoreCase("deny")) {
|
||||||
|
List<String> joins = getClanJoinRequests(args, playerUUID);
|
||||||
|
if (joins != null) return joins;
|
||||||
|
} else if (args[0].equalsIgnoreCase("modify")) {
|
||||||
|
return Stream.of("name", "tag")
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
} else if (clans.isVice(playerUUID)) {
|
||||||
|
if (args[0].equalsIgnoreCase("invite")) {
|
||||||
|
return Bukkit.getOnlinePlayers().stream()
|
||||||
|
.filter(p -> !clans.isMember(p.getUniqueId()))
|
||||||
|
.map(Player::getName)
|
||||||
|
.filter(name -> name.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("kick")) {
|
||||||
|
return clans.getClanByMember(playerUUID).getMembers().stream()
|
||||||
|
.map(UUID::toString)
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("accept")) {
|
||||||
|
List<String> joins = getClanJoinRequests(args, playerUUID);
|
||||||
|
if (joins != null) return joins;
|
||||||
|
} else if (args[0].equalsIgnoreCase("deny")) {
|
||||||
|
List<String> joins = getClanJoinRequests(args, playerUUID);
|
||||||
|
if (joins != null) return joins;
|
||||||
|
} else if (args[0].equalsIgnoreCase("demote")) {
|
||||||
|
return Collections.singletonList(plugin.getServer().getOfflinePlayer(clans.getClanByMember(playerUUID).getViceUUID()).getName());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (args[0].equalsIgnoreCase("accept")) {
|
||||||
|
return clanInvites.entrySet().stream()
|
||||||
|
.filter(entry -> entry.getValue().contains(playerUUID))
|
||||||
|
.map(entry -> entry.getKey().getName())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("deny")) {
|
||||||
|
return clanInvites.entrySet().stream()
|
||||||
|
.filter(entry -> entry.getValue().contains(playerUUID))
|
||||||
|
.map(entry -> entry.getKey().getName())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("join")) {
|
||||||
|
return clans.getClans().stream()
|
||||||
|
.map(Clan::getName)
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else if (args[0].equalsIgnoreCase("create")) {
|
||||||
|
return Collections.singletonList("<name>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (args.length == 3) {
|
||||||
|
if (clans.isLeader(playerUUID)) {
|
||||||
|
if (args[1].equalsIgnoreCase("name")) {
|
||||||
|
return Collections.singletonList("<name>");
|
||||||
|
} else if (args[1].equalsIgnoreCase("tag")) {
|
||||||
|
return Collections.singletonList("<tag>");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (args[0].equalsIgnoreCase("create")) {
|
||||||
|
return Collections.singletonList("<tag>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
private List<String> getClanJoinRequests(@NotNull String[] args, UUID playerUUID) {
|
||||||
|
LinkedList<UUID> joins = clanJoins.get(clans.getClanByMember(playerUUID));
|
||||||
|
if (joins != null) {
|
||||||
|
return joins.stream()
|
||||||
|
.map(uuid -> plugin.getServer().getOfflinePlayer(uuid).getName())
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.filter(s -> s.startsWith(args[1]))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
package me.freezy.plugins.papermc.blazesmp.command.util;
|
||||||
|
|
||||||
|
import me.freezy.plugins.papermc.blazesmp.BlazeSMP;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.*;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@SuppressWarnings("ALL")
|
||||||
|
public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
||||||
|
protected static Logger logger = Logger.getLogger(BlazeSMP.class.getName());
|
||||||
|
protected static CommandMap cmap;
|
||||||
|
protected final String command;
|
||||||
|
protected final String description;
|
||||||
|
protected final List<String> alias;
|
||||||
|
protected final String usage;
|
||||||
|
protected final String permissionMessage;
|
||||||
|
protected final String permission;
|
||||||
|
|
||||||
|
public SimpleCommand(String command) {
|
||||||
|
this(command, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage) {
|
||||||
|
this(command, usage, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description) {
|
||||||
|
this(command, usage, description, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description, List<String> alias) {
|
||||||
|
this(command, usage, description, null, null, alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description, String permissionMessage) {
|
||||||
|
this(command, usage, description, permissionMessage, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description, String permissionMessage, String permission) {
|
||||||
|
this(command, usage, description, permissionMessage, permission, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description, String permission, List<String> alias) {
|
||||||
|
this(command, usage, description, null, permission, alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleCommand(String command, String usage, String description, String permissionMessage, String permission, List<String> alias) {
|
||||||
|
this.command = command;
|
||||||
|
this.description = description;
|
||||||
|
this.alias = alias;
|
||||||
|
this.usage = usage;
|
||||||
|
this.permissionMessage = permissionMessage;
|
||||||
|
this.permission = permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
ReflectCommand cmd = new ReflectCommand(this.command);
|
||||||
|
if (this.alias != null) cmd.setAliases(this.alias);
|
||||||
|
if (this.description != null) cmd.setDescription(this.description);
|
||||||
|
if (this.usage != null) cmd.setUsage(this.usage);
|
||||||
|
if (this.permissionMessage != null) cmd.setPermissionMessage(this.permissionMessage);
|
||||||
|
if (this.permission != null) cmd.setPermission(this.permission);
|
||||||
|
getCommandMap().register("blazesmp", cmd);
|
||||||
|
cmd.setExecutor(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
final CommandMap getCommandMap() {
|
||||||
|
if (cmap == null) {
|
||||||
|
try {
|
||||||
|
final Field f = Bukkit.getServer().getClass().getDeclaredField("commandMap");
|
||||||
|
f.setAccessible(true);
|
||||||
|
cmap = (CommandMap) f.get(Bukkit.getServer());
|
||||||
|
return getCommandMap();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.severe(String.valueOf(e));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return cmap;
|
||||||
|
}
|
||||||
|
return getCommandMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class ReflectCommand extends Command {
|
||||||
|
private SimpleCommand exe = null;
|
||||||
|
|
||||||
|
private ReflectCommand(String command) {
|
||||||
|
super(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutor(SimpleCommand exe) {
|
||||||
|
this.exe = exe;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull CommandSender sender, @NotNull String label, String[] args) {
|
||||||
|
if (exe != null) {
|
||||||
|
return exe.onCommand(sender, this, label, args);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, String[] args) {
|
||||||
|
if (exe != null) {
|
||||||
|
return exe.onTabComplete(sender, this, alias, args);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -187,6 +187,18 @@ public class Clan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLeader(UUID playerUUID) {
|
||||||
|
return this.leaderUUID.equals(playerUUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVice(UUID playerUUID) {
|
||||||
|
return this.viceUUID != null && this.viceUUID.equals(playerUUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMember(UUID playerUUID) {
|
||||||
|
return this.leaderUUID.equals(playerUUID) || (this.viceUUID != null && this.viceUUID.equals(playerUUID)) || this.members.contains(playerUUID);
|
||||||
|
}
|
||||||
|
|
||||||
// Helper classes to represent the JSON structure
|
// Helper classes to represent the JSON structure
|
||||||
|
|
||||||
private static class ClanJson {
|
private static class ClanJson {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package me.freezy.plugins.papermc.blazesmp.module.manager;
|
package me.freezy.plugins.papermc.blazesmp.module.manager;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import me.freezy.plugins.papermc.blazesmp.module.Clan;
|
import me.freezy.plugins.papermc.blazesmp.module.Clan;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -7,25 +8,22 @@ import java.util.LinkedList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@Getter
|
||||||
public class Clans {
|
public class Clans {
|
||||||
private static final Logger LOGGER = Logger.getLogger("ClanManager");
|
private static final Logger LOGGER = Logger.getLogger("ClanManager");
|
||||||
private static final String CLAN_STORAGE_PATH = "plugins/BlazeSMP/storage/clans/";
|
private static final String CLAN_STORAGE_PATH = "plugins/BlazeSMP/storage/clans/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns the list of loaded clans.
|
||||||
|
*
|
||||||
|
*/
|
||||||
private final LinkedList<Clan> clans;
|
private final LinkedList<Clan> clans;
|
||||||
|
|
||||||
public Clans() {
|
public Clans() {
|
||||||
this.clans = new LinkedList<>();
|
this.clans = new LinkedList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of loaded clans.
|
|
||||||
*
|
|
||||||
* @return LinkedList of Clan objects.
|
|
||||||
*/
|
|
||||||
public LinkedList<Clan> getClans() {
|
|
||||||
return clans;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads all clan files from the storage folder.
|
* Loads all clan files from the storage folder.
|
||||||
*/
|
*/
|
||||||
|
@ -124,4 +122,49 @@ public class Clans {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLeader(UUID playerUUID) {
|
||||||
|
for (Clan clan : clans) {
|
||||||
|
if (clan.getLeaderUUID().equals(playerUUID)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVice(UUID playerUUID) {
|
||||||
|
for (Clan clan : clans) {
|
||||||
|
if (clan.getViceUUID() != null && clan.getViceUUID().equals(playerUUID)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMember(UUID playerUUID) {
|
||||||
|
for (Clan clan : clans) {
|
||||||
|
if (clan.getMembers().contains(playerUUID)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInClan(UUID playerUUID) {
|
||||||
|
for (Clan clan : clans) {
|
||||||
|
if (clan.getMembers().contains(playerUUID) || clan.getLeaderUUID().equals(playerUUID) || (clan.getViceUUID() != null && clan.getViceUUID().equals(playerUUID))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clan getClanByMember(UUID playerUUID) {
|
||||||
|
for (Clan clan : clans) {
|
||||||
|
if (clan.getMembers().contains(playerUUID) || clan.getLeaderUUID().equals(playerUUID) || (clan.getViceUUID() != null && clan.getViceUUID().equals(playerUUID))) {
|
||||||
|
return clan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,13 +18,14 @@ import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
@Getter
|
||||||
public class Homes {
|
public class Homes {
|
||||||
private static final String FILE_PATH = "plugins/BlazeSMP/storage/homes.json";
|
private static final String FILE_PATH = "plugins/BlazeSMP/storage/homes.json";
|
||||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||||
private static final Logger LOGGER = Logger.getLogger("Homes");
|
private static final Logger LOGGER = Logger.getLogger("Homes");
|
||||||
|
|
||||||
// Mapping of player UUID to their home location
|
// Mapping of player UUID to their home location
|
||||||
@Getter private final LinkedHashMap<UUID, Location> homes;
|
private final LinkedHashMap<UUID, Location> homes;
|
||||||
|
|
||||||
public Homes() {
|
public Homes() {
|
||||||
this.homes = new LinkedHashMap<>();
|
this.homes = new LinkedHashMap<>();
|
||||||
|
|
|
@ -2,6 +2,7 @@ package me.freezy.plugins.papermc.blazesmp.module.manager;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import lombok.Getter;
|
||||||
import me.freezy.plugins.papermc.blazesmp.module.ProtectedBlock;
|
import me.freezy.plugins.papermc.blazesmp.module.ProtectedBlock;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
@ -19,6 +20,7 @@ import java.util.logging.Logger;
|
||||||
/**
|
/**
|
||||||
* Manager class for loading and saving protected blocks.
|
* Manager class for loading and saving protected blocks.
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public class ProtectedBlocks {
|
public class ProtectedBlocks {
|
||||||
private static final String FILE_PATH = "plugins/BlazeSMP/storage/protected_blocks.json";
|
private static final String FILE_PATH = "plugins/BlazeSMP/storage/protected_blocks.json";
|
||||||
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
|
||||||
|
@ -31,10 +33,6 @@ public class ProtectedBlocks {
|
||||||
this.blocks = new ArrayList<>();
|
this.blocks = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProtectedBlock> getBlocks() {
|
|
||||||
return blocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads protected blocks from the JSON file.
|
* Loads protected blocks from the JSON file.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue