Updated some stuff
This commit is contained in:
parent
9ae7e45911
commit
e8804233e1
56 changed files with 919 additions and 298 deletions
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>nl.iobyte</groupId>
|
||||
<artifactId>themepark</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.2</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -40,6 +40,10 @@
|
|||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
|
@ -52,6 +56,10 @@
|
|||
<id>MG-Dev Jenkins CI Maven Repository</id>
|
||||
<url>https://ci.mg-dev.eu/plugin/repository/everything</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -146,6 +154,62 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-legacy</artifactId>
|
||||
<version>6.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>6.1.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-core</artifactId>
|
||||
<version>6.1.4-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>truezip</artifactId>
|
||||
<groupId>de.schlichtherle</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>js</artifactId>
|
||||
<groupId>rhino</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>paranamer</artifactId>
|
||||
<groupId>com.thoughtworks.paranamer</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jlibnoise</artifactId>
|
||||
<groupId>com.sk89q.lib</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jchronic</artifactId>
|
||||
<groupId>com.sk89q</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>guava</artifactId>
|
||||
<groupId>com.google.guava</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<groupId>org.yaml</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>gson</artifactId>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
|
30
pom.xml
30
pom.xml
|
@ -12,9 +12,13 @@
|
|||
|
||||
<groupId>nl.iobyte</groupId>
|
||||
<artifactId>themepark</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.0.2</version>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
|
@ -27,6 +31,10 @@
|
|||
<id>MG-Dev Jenkins CI Maven Repository</id>
|
||||
<url>https://ci.mg-dev.eu/plugin/repository/everything</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -39,7 +47,7 @@
|
|||
<dependency>
|
||||
<groupId>nl.iobyte</groupId>
|
||||
<artifactId>commandapi</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.iobyte</groupId>
|
||||
|
@ -84,6 +92,24 @@
|
|||
<artifactId>XSeries</artifactId>
|
||||
<version>8.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>worldguard-legacy</artifactId>
|
||||
<version>6.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-bukkit</artifactId>
|
||||
<version>6.1.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>worldedit-core</artifactId>
|
||||
<version>6.1.4-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -9,12 +9,15 @@ import nl.iobyte.themepark.api.load.DataLoadService;
|
|||
import nl.iobyte.themepark.api.menu.MenuService;
|
||||
import nl.iobyte.themepark.api.ridecount.RideCountService;
|
||||
import nl.iobyte.themepark.api.sign.SignManager;
|
||||
import nl.iobyte.themepark.api.sync.SyncService;
|
||||
import nl.iobyte.themepark.api.sync.enums.SyncType;
|
||||
|
||||
public class ThemeParkAPI {
|
||||
|
||||
//Data
|
||||
private ConfigurationManager configurationManager;
|
||||
private final DataLoadService dataLoadService = new DataLoadService();
|
||||
private final SyncService syncService = new SyncService();
|
||||
private final DatabaseService databaseService = new DatabaseService();
|
||||
private final MenuService menuService = new MenuService();
|
||||
private EventDispatcher eventDispatcher;
|
||||
|
@ -34,6 +37,7 @@ public class ThemeParkAPI {
|
|||
//Load data
|
||||
eventDispatcher = new EventDispatcher(ThemePark.getInstance());
|
||||
dataLoadService.init();
|
||||
syncService.init();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,6 +45,7 @@ public class ThemeParkAPI {
|
|||
*/
|
||||
public void disable() {
|
||||
databaseService.stop();
|
||||
syncService.callSync(SyncType.HALT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,6 +12,7 @@ public enum StorageKey {
|
|||
MYSQL_PASSWORD(StorageLocation.SETTINGS, "mysql.password"),
|
||||
|
||||
//Menu Settings
|
||||
MENU_ENABLED_MAIN(StorageLocation.MENU, "main.menu.enabled"),
|
||||
MENU_SIZE_MAIN(StorageLocation.MENU, "menu.main.size"),
|
||||
MENU_TITLE_MAIN(StorageLocation.MENU, "menu.main.title"),
|
||||
MENU_TITLE_STATUS(StorageLocation.MENU, "menu.status.title"),
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ConfigurationUpdater {
|
|||
|
||||
public String getCurrentVersion() {
|
||||
if(!config.contains("version"))
|
||||
return "1.0";
|
||||
return "0.0";
|
||||
|
||||
return config.getString("version");
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package nl.iobyte.themepark.api.event.attraction;
|
||||
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.event.objects.AttractionEvent;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class AttractionPreStatusChangeEvent extends AttractionEvent<Status> implements Cancellable {
|
||||
|
||||
private boolean b;
|
||||
|
||||
public AttractionPreStatusChangeEvent(Attraction attraction, Status old, Status current) {
|
||||
super(attraction, old, current);
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return b;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean b) {
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
}
|
|
@ -120,7 +120,13 @@ public class StatusDataLoader implements IDataLoader {
|
|||
for(String id : section.getKeys(false)) {
|
||||
String name = config.getString("attractions."+id+".name");
|
||||
String cover = config.getString("attractions."+id+".cover");
|
||||
if(cover == null || cover.isEmpty())
|
||||
cover = "https://via.placeholder.com/500x500";
|
||||
|
||||
Status status = Status.get(config.getString("attractions."+id+".status"));
|
||||
if(status == null)
|
||||
status = Status.CLOSED;
|
||||
|
||||
Location location = LocationUtil.fromString(config.getString("attractions."+id+".location"));
|
||||
|
||||
Attraction attraction = new Attraction(id, region.getID(), name, cover, status, location);
|
||||
|
|
|
@ -13,6 +13,7 @@ import nl.iobyte.themepark.api.attraction.objects.Region;
|
|||
import nl.iobyte.themepark.api.config.enums.StorageKey;
|
||||
import nl.iobyte.themepark.api.menu.objects.actions.PageAction;
|
||||
import nl.iobyte.themepark.api.menu.objects.actions.TPAction;
|
||||
import nl.iobyte.themepark.api.message.MessageKey;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
@ -206,7 +207,7 @@ public class StatusMenu {
|
|||
|
||||
if(page_size > 1) {
|
||||
ItemBuilder builder = new ItemBuilder(Material.MINECART);
|
||||
builder.setName("&6Page: &f" + (i + 1));
|
||||
builder.setName(MessageKey.MENU_PAGE.getMessage().replaceAll("%PAGE%", Integer.toString(i + 1)));
|
||||
page.setItem(size - 5, new MenuItem(builder.getItem(), true));
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +244,7 @@ public class StatusMenu {
|
|||
* @return MenuItem
|
||||
*/
|
||||
private MenuItem getNext(int page) {
|
||||
return getPage("&6&LNext \u23F5", page + 1);
|
||||
return getPage(MessageKey.MENU_NEXT.getMessage(), page + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -252,7 +253,7 @@ public class StatusMenu {
|
|||
* @return MenuItem
|
||||
*/
|
||||
private MenuItem getPrevious(int page) {
|
||||
return getPage("&6&L\u23F4 Previous", page - 1);
|
||||
return getPage(MessageKey.MENU_PREVIOUS.getMessage(), page - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ public class TPAction extends MenuAction {
|
|||
}
|
||||
|
||||
public void execute(Player player) {
|
||||
Bukkit.dispatchCommand(player, "pp attraction warp "+attraction.getID());
|
||||
Bukkit.dispatchCommand(player, "themepark attraction warp "+attraction.getID());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,16 +9,10 @@ public enum MessageKey {
|
|||
//Prefix
|
||||
PREFIX("prefix"),
|
||||
|
||||
//Session
|
||||
CLIENT_UNABLE_TO_CONNECT("client.connect.unable"),
|
||||
CLIENT_GENERATE_TO_CONNECT("client.connect.generate"),
|
||||
CLIENT_CLICK_TO_CONNECT("client.connect.click"),
|
||||
CLIENT_HOVER_TO_CONNECT("client.connect.hover"),
|
||||
|
||||
//Connection
|
||||
CLIENT_CONNECTION_EXISTS("client.connection.exists"),
|
||||
CLIENT_CONNECTION_OPEN("client.connection.open"),
|
||||
CLIENT_CONNECTION_CLOSED("client.connection.closed"),
|
||||
//Menu
|
||||
MENU_PREVIOUS("menu.previous"),
|
||||
MENU_PAGE("menu.page"),
|
||||
MENU_NEXT("menu.next"),
|
||||
|
||||
//Ridecount
|
||||
RIDECOUNT_ADD("ridecount.add"),
|
||||
|
|
72
src/main/java/nl/iobyte/themepark/api/sync/SyncService.java
Normal file
72
src/main/java/nl/iobyte/themepark/api/sync/SyncService.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package nl.iobyte.themepark.api.sync;
|
||||
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.sync.enums.SyncType;
|
||||
import nl.iobyte.themepark.api.sync.interfaces.ISync;
|
||||
import nl.iobyte.themepark.api.sync.objects.ConfigurationSync;
|
||||
import nl.iobyte.themepark.api.sync.objects.SignSync;
|
||||
import org.bukkit.Bukkit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SyncService {
|
||||
|
||||
private int TaskID = -1;
|
||||
private final Map<SyncType, ArrayList<ISync>> synchronisations = new HashMap<>();
|
||||
|
||||
public SyncService() {
|
||||
addSynchronisation(new ConfigurationSync(), SyncType.POLL, SyncType.HALT);
|
||||
addSynchronisation(new SignSync(), SyncType.POLL, SyncType.HALT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start Synchronisation Service
|
||||
*/
|
||||
public void init() {
|
||||
if(TaskID != -1)
|
||||
return;
|
||||
|
||||
//Boot
|
||||
callSync(SyncType.BOOT);
|
||||
|
||||
//Register listeners for state changes
|
||||
long delay = 15 * 60 * 20; //Set to every 15 minutes
|
||||
TaskID = Bukkit.getScheduler().runTaskTimerAsynchronously(ThemePark.getInstance(), () -> callSync(SyncType.POLL), delay, delay).getTaskId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add ISync to Synchronisation Service
|
||||
* @param sync ISync
|
||||
* @param types SyncType[]
|
||||
*/
|
||||
public void addSynchronisation(ISync sync, SyncType... types) {
|
||||
if(sync == null || types == null || types.length == 0)
|
||||
return;
|
||||
|
||||
for(SyncType type : types)
|
||||
if(type != null)
|
||||
Objects.requireNonNull(synchronisations.computeIfAbsent(
|
||||
type,
|
||||
syncType -> new ArrayList<>()
|
||||
)).add(sync);
|
||||
}
|
||||
|
||||
public ArrayList<ISync> getOfType(SyncType type) {
|
||||
if(type == null)
|
||||
return null;
|
||||
|
||||
return synchronisations.getOrDefault(type, new ArrayList<>());
|
||||
}
|
||||
|
||||
public void callSync(SyncType type) {
|
||||
if(type == null)
|
||||
return;
|
||||
|
||||
for(ISync sync : getOfType(type))
|
||||
sync.sync();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package nl.iobyte.themepark.api.sync.enums;
|
||||
|
||||
public enum SyncType {
|
||||
|
||||
BOOT,
|
||||
POLL,
|
||||
HALT
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package nl.iobyte.themepark.api.sync.interfaces;
|
||||
|
||||
public interface ISync {
|
||||
|
||||
/**
|
||||
* Called when synchronising
|
||||
*/
|
||||
void sync();
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package nl.iobyte.themepark.api.sync.objects;
|
||||
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.ThemeParkAPI;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageLocation;
|
||||
import nl.iobyte.themepark.api.sync.interfaces.ISync;
|
||||
import nl.iobyte.themepark.logger.ThemeParkLogger;
|
||||
|
||||
public class ConfigurationSync implements ISync {
|
||||
|
||||
/**
|
||||
* Save all configuration files
|
||||
*/
|
||||
public void sync() {
|
||||
ThemeParkAPI api = ThemePark.getInstance().getAPI();
|
||||
for(StorageLocation location : StorageLocation.values())
|
||||
if(location != StorageLocation.SETTINGS)
|
||||
api.getConfigurationManager().save(location);
|
||||
|
||||
for(Region region : api.getAttractionService().getRegions().values())
|
||||
region.getConfiguration().save();
|
||||
|
||||
ThemeParkLogger.toConsole("Configuration data saved to file");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package nl.iobyte.themepark.api.sync.objects;
|
||||
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.ThemeParkAPI;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.config.ConfigurationManager;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageLocation;
|
||||
import nl.iobyte.themepark.api.sign.SignManager;
|
||||
import nl.iobyte.themepark.api.sign.objects.StatusSign;
|
||||
import nl.iobyte.themepark.api.sync.interfaces.ISync;
|
||||
import nl.iobyte.themepark.logger.ThemeParkLogger;
|
||||
import nl.iobyte.themepark.utils.LocationUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SignSync implements ISync {
|
||||
|
||||
/**
|
||||
* Save all configuration files
|
||||
*/
|
||||
public void sync() {
|
||||
ThemeParkAPI api = ThemePark.getInstance().getAPI();
|
||||
SignManager manager = api.getSignManager();
|
||||
ConfigurationManager config = api.getConfigurationManager();
|
||||
|
||||
for(Map.Entry<Attraction, ArrayList<StatusSign>> entry : manager.getSigns().entrySet()) {
|
||||
List<String> array = new ArrayList<>();
|
||||
for(StatusSign sign : entry.getValue()) {
|
||||
String str = LocationUtil.toString(sign.getLocation());
|
||||
if(!str.isEmpty())
|
||||
array.add(str);
|
||||
}
|
||||
|
||||
config.set(StorageLocation.SIGN_DATA, "signs." + entry.getKey().getID(), array);
|
||||
}
|
||||
|
||||
config.save(StorageLocation.SIGN_DATA);
|
||||
ThemeParkLogger.toConsole("Sign data saved to file");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package nl.iobyte.themepark.commands;
|
||||
|
||||
import nl.iobyte.commandapi.CommandFactory;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.middlewares.PermissionMiddleware;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.commands.executors.ConsoleExecutor;
|
||||
import nl.iobyte.themepark.commands.executors.PlayerExecutor;
|
||||
import nl.iobyte.themepark.commands.subcommands.HelpCommand;
|
||||
import nl.iobyte.themepark.commands.subcommands.ItemCommand;
|
||||
import nl.iobyte.themepark.commands.subcommands.MenuCommand;
|
||||
|
@ -10,6 +13,10 @@ import nl.iobyte.themepark.commands.subcommands.attraction.AttractionCommands;
|
|||
import nl.iobyte.themepark.commands.subcommands.region.RegionCommands;
|
||||
import nl.iobyte.themepark.commands.subcommands.ridecount.RideCountCommands;
|
||||
import nl.iobyte.themepark.commands.subcommands.status.StatusCommands;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ThemeParkCommand {
|
||||
|
||||
|
@ -38,7 +45,14 @@ public class ThemeParkCommand {
|
|||
factory.addMiddleware(new PermissionMiddleware());
|
||||
|
||||
//Register command
|
||||
factory.registerCommand(ThemePark.getInstance());
|
||||
ThemePark.getInstance().getCommand(factory.getName()).setExecutor((sender, command, s, args) -> {
|
||||
ICommandExecutor executor = new ConsoleExecutor(sender);
|
||||
if(sender instanceof Player)
|
||||
executor = new PlayerExecutor((Player) sender);
|
||||
|
||||
factory.onCommand(executor, args);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import nl.iobyte.commandapi.objects.ArgumentCheck;
|
|||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionArgument implements ICommandArgument<Attraction> {
|
||||
|
@ -20,23 +20,23 @@ public class AttractionArgument implements ICommandArgument<Attraction> {
|
|||
|
||||
/**
|
||||
* Check if argument is valid Attraction
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Boolean
|
||||
*/
|
||||
public ArgumentCheck checkArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return new ArgumentCheck(ThemePark.getInstance().getAPI().getAttractionService().hasAttraction(args[0]), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Attraction passed by command
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Attraction
|
||||
*/
|
||||
public Attraction getArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public Attraction getArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return ThemePark.getInstance().getAPI().getAttractionService().getAttraction(args[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package nl.iobyte.themepark.commands.arguments;
|
||||
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandArgument;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.ArgumentCheck;
|
||||
import org.bukkit.ChatColor;
|
||||
import java.util.List;
|
||||
|
||||
public class MaterialArgument implements ICommandArgument<XMaterial> {
|
||||
|
||||
public String getMessage(String[] args) {
|
||||
return "No material with name: "+ ChatColor.WHITE+args[0];
|
||||
}
|
||||
|
||||
public ArgumentCheck checkArgument(ICommandExecutor iCommandExecutor, String[] args, List<Object> list) {
|
||||
return new ArgumentCheck(XMaterial.matchXMaterial(args[0]).isPresent(), 1);
|
||||
}
|
||||
|
||||
public XMaterial getArgument(ICommandExecutor iCommandExecutor, String[] args, List<Object> list) {
|
||||
return XMaterial.matchXMaterial(args[0]).orElse(XMaterial.RED_CONCRETE);
|
||||
}
|
||||
|
||||
}
|
|
@ -4,7 +4,7 @@ import nl.iobyte.commandapi.interfaces.ICommandArgument;
|
|||
import nl.iobyte.commandapi.objects.ArgumentCheck;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class NoAttractionArgument implements ICommandArgument<String> {
|
||||
|
@ -19,23 +19,23 @@ public class NoAttractionArgument implements ICommandArgument<String> {
|
|||
|
||||
/**
|
||||
* Check if argument is a not existing Attraction
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Boolean
|
||||
*/
|
||||
public ArgumentCheck checkArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return new ArgumentCheck(!ThemePark.getInstance().getAPI().getAttractionService().hasAttraction(args[0]), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String passed by command
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return String
|
||||
*/
|
||||
public String getArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public String getArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return args[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import nl.iobyte.commandapi.interfaces.ICommandArgument;
|
|||
import nl.iobyte.commandapi.objects.ArgumentCheck;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class NoRegionArgument implements ICommandArgument<String> {
|
||||
|
@ -19,23 +19,23 @@ public class NoRegionArgument implements ICommandArgument<String> {
|
|||
|
||||
/**
|
||||
* Check if argument is a not existing Attraction
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Boolean
|
||||
*/
|
||||
public ArgumentCheck checkArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return new ArgumentCheck(!ThemePark.getInstance().getAPI().getAttractionService().hasRegion(args[0]), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get String passed by command
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return String
|
||||
*/
|
||||
public String getArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public String getArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return args[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package nl.iobyte.themepark.commands.arguments;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.ICommandArgument;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.ArgumentCheck;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayerArgument implements ICommandArgument<Player> {
|
||||
|
||||
public String getMessage(String[] args) {
|
||||
return "No player with name: "+ ChatColor.WHITE+args[0];
|
||||
}
|
||||
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> list) {
|
||||
return new ArgumentCheck(Bukkit.getPlayer(args[0]) != null, 1);
|
||||
}
|
||||
|
||||
public Player getArgument(ICommandExecutor sender, String[] args, List<Object> list) {
|
||||
return Bukkit.getPlayer(args[0]);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package nl.iobyte.themepark.commands.arguments;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.ICommandArgument;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.ArgumentCheck;
|
||||
import nl.iobyte.themepark.commands.objects.SpigotPlayerSelector;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class PlayersArgument implements ICommandArgument<List<Player>> {
|
||||
|
||||
/**
|
||||
* Message to display when giving an error
|
||||
* @return String
|
||||
*/
|
||||
public String getMessage(String[] args) {
|
||||
return "No player(s) found for: "+ ChatColor.WHITE+args[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if argument is valid Player
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param list Previous arguments
|
||||
* @return Boolean
|
||||
*/
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> list) {
|
||||
List<Player> players = new SpigotPlayerSelector(args[0]).getPlayers(sender);
|
||||
return new ArgumentCheck(players != null && !players.isEmpty(), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Player passed by command
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param list Previous arguments
|
||||
* @return Player
|
||||
*/
|
||||
public List<Player> getArgument(ICommandExecutor sender, String[] args, List<Object> list) {
|
||||
return new SpigotPlayerSelector(args[0]).getPlayers(sender);
|
||||
}
|
||||
|
||||
}
|
|
@ -5,7 +5,7 @@ import nl.iobyte.commandapi.objects.ArgumentCheck;
|
|||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class RegionArgument implements ICommandArgument<Region> {
|
||||
|
@ -20,23 +20,23 @@ public class RegionArgument implements ICommandArgument<Region> {
|
|||
|
||||
/**
|
||||
* Check if argument is valid Region
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Boolean
|
||||
*/
|
||||
public ArgumentCheck checkArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public ArgumentCheck checkArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return new ArgumentCheck(ThemePark.getInstance().getAPI().getAttractionService().hasRegion(args[0]), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Region passed by command
|
||||
* @param sender CommandSender
|
||||
* @param sender ICommandExecutor
|
||||
* @param args Arguments passed by Command
|
||||
* @param previousArguments Previous arguments
|
||||
* @return Region
|
||||
*/
|
||||
public Region getArgument(CommandSender sender, String[] args, List<Object> previousArguments) {
|
||||
public Region getArgument(ICommandExecutor sender, String[] args, List<Object> previousArguments) {
|
||||
return ThemePark.getInstance().getAPI().getAttractionService().getRegion(args[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package nl.iobyte.themepark.commands.executors;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class ConsoleExecutor implements ICommandExecutor {
|
||||
|
||||
private final CommandSender executor;
|
||||
|
||||
public ConsoleExecutor(CommandSender executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
public boolean isPlayer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasPermission(String s) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void sendMessage(String s) {
|
||||
executor.sendMessage(s);
|
||||
}
|
||||
|
||||
public Object getOriginal() {
|
||||
return executor;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package nl.iobyte.themepark.commands.executors;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerExecutor implements ICommandExecutor {
|
||||
|
||||
private final Player player;
|
||||
|
||||
public PlayerExecutor(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public boolean isPlayer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasPermission(String s) {
|
||||
return player.hasPermission(s);
|
||||
}
|
||||
|
||||
public void sendMessage(String s) {
|
||||
player.sendMessage(s);
|
||||
}
|
||||
|
||||
public Object getOriginal() {
|
||||
return player;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package nl.iobyte.themepark.commands.objects;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Reflection {
|
||||
|
||||
private static final HashMap<String, Class<?>> classes = new HashMap<>();
|
||||
|
||||
public static Class<?> getClass(String path) {
|
||||
if(classes.containsKey(path))
|
||||
return classes.get(path);
|
||||
|
||||
try {
|
||||
Class<?> clazz = Class.forName(path);
|
||||
classes.put(path, clazz);
|
||||
return clazz;
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
classes.put(path, null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package nl.iobyte.themepark.commands.objects;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Use selectors in commands!
|
||||
*
|
||||
* @author Mindgamesnl
|
||||
*
|
||||
* Code from
|
||||
* https://github.com/Mindgamesnl/OpenAudioMc/blob/master/plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/players/objects/SpigotPlayerSelector.java
|
||||
*/
|
||||
public class SpigotPlayerSelector {
|
||||
|
||||
private final String selector;
|
||||
|
||||
public SpigotPlayerSelector(String selector) {
|
||||
this.selector = selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* this turns selectors like @a[r=5] into a usable list, since
|
||||
* 1.13 spigot removed this feature, FOR SOME REASON.. thanks guys..
|
||||
*
|
||||
* @param sender the sender
|
||||
* @return players following the selector
|
||||
*/
|
||||
public List<Player> getPlayers(ICommandExecutor sender) {
|
||||
List<Player> players = new ArrayList<>();
|
||||
|
||||
if (selector.startsWith("@p")) {
|
||||
//get Location
|
||||
Location standPoint = getLocation(sender);
|
||||
|
||||
if (getArgument("r").length() != 0) {
|
||||
int radius = Integer.parseInt(getArgument("r"));
|
||||
Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.min(Comparator.comparing(player -> player.getLocation().distance(standPoint)))
|
||||
.filter(player -> radius > player.getLocation().distance(standPoint))
|
||||
.ifPresent(players::add);
|
||||
}
|
||||
|
||||
if (getArgument("distance").length() != 0) {
|
||||
int distance = Integer.parseInt(getArgument("distance"));
|
||||
Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.min(Comparator.comparing(player -> player.getLocation().distance(standPoint)))
|
||||
.filter(player -> distance > player.getLocation().distance(standPoint))
|
||||
.ifPresent(players::add);
|
||||
} else {
|
||||
Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.min(Comparator.comparing(player -> player.getLocation().distance(standPoint)))
|
||||
.ifPresent(players::add);
|
||||
}
|
||||
} else if (selector.startsWith("@a")) {
|
||||
//everyone
|
||||
Location standPoint = getLocation(sender);
|
||||
|
||||
if(getArgument("region").length() != 0) {
|
||||
WGManager manager = WGManager.getInstance();
|
||||
String targetRegion = getArgument("region");
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
manager.getApplicableRegionSet(player.getLocation(standPoint)).forEach(region -> {
|
||||
if (region.getId().equalsIgnoreCase(targetRegion))
|
||||
players.add(player);
|
||||
});
|
||||
}
|
||||
} else if (getArgument("r").length() != 0) {
|
||||
int radius = Integer.parseInt(getArgument("r"));
|
||||
players.addAll(Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.filter(player -> radius > player.getLocation().distance(standPoint))
|
||||
.collect(Collectors.toList()));
|
||||
} else if (getArgument("distance").length() != 0) {
|
||||
int distance = Integer.parseInt(getArgument("distance"));
|
||||
players.addAll(Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.filter(player -> distance > player.getLocation().distance(standPoint))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
else {
|
||||
players.addAll(Bukkit.getOnlinePlayers().stream()
|
||||
.filter(player -> player.getLocation().getWorld().getName().equals(standPoint.getWorld().getName()))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
} else if (selector.length() <= 16) {
|
||||
//player
|
||||
Player player = Bukkit.getPlayer(selector);
|
||||
if (player != null)
|
||||
players.add(player);
|
||||
}
|
||||
|
||||
return players;
|
||||
}
|
||||
|
||||
/**
|
||||
* attempt to parse the location
|
||||
*
|
||||
* @param commandSender the sender
|
||||
* @return the location or null
|
||||
*/
|
||||
private Location getLocation(ICommandExecutor commandSender) {
|
||||
Location initialLocation = new Location(Bukkit.getWorlds().get(0), 0, 0, 0);
|
||||
if (commandSender.isPlayer()) {
|
||||
initialLocation = ((Player) commandSender.getOriginal()).getLocation();
|
||||
} else if (commandSender.getOriginal() instanceof BlockCommandSender) {
|
||||
initialLocation = ((BlockCommandSender) commandSender.getOriginal()).getBlock().getLocation();
|
||||
}
|
||||
|
||||
if (!getArgument("x").equals("") && !getArgument("y").equals("") && !getArgument("z").equals("")) {
|
||||
try {
|
||||
int x = Integer.parseInt(getArgument("x"));
|
||||
int y = Integer.parseInt(getArgument("y"));
|
||||
int z = Integer.parseInt(getArgument("z"));
|
||||
return new Location(initialLocation.getWorld(), x, y, z);
|
||||
} catch (Exception e) {
|
||||
return initialLocation;
|
||||
}
|
||||
}
|
||||
|
||||
return initialLocation;
|
||||
}
|
||||
|
||||
private String getArgument(String key) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
String[] arguments = selector.split(key + "=");
|
||||
if (arguments.length == 1) return "";
|
||||
for (byte type : arguments[1].getBytes()) {
|
||||
char element = (char) type;
|
||||
if (element == ',' || element == ']') {
|
||||
return result.toString();
|
||||
} else {
|
||||
result.append(element);
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package nl.iobyte.themepark.commands.objects;
|
||||
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class WGManager {
|
||||
|
||||
private static String wgVerStr = null;
|
||||
private static WGManager instance = null;
|
||||
|
||||
public static WGManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new WGManager();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public WorldGuardPlugin getWorldGuard() {
|
||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if ((!(plugin instanceof WorldGuardPlugin)))
|
||||
return null;
|
||||
|
||||
return (WorldGuardPlugin) plugin;
|
||||
}
|
||||
|
||||
public RegionManager getRegionManager(World w) {
|
||||
if (getWgVer().contains("7.")) {
|
||||
try {
|
||||
Class<?> wgClass = Reflection.getClass("com.sk89q.worldguard.WorldGuard");
|
||||
if(wgClass == null)
|
||||
return null;
|
||||
|
||||
Object instance = wgClass.getDeclaredMethod("getInstance").invoke(null);
|
||||
Class<?> wgInstanceClass = instance.getClass();
|
||||
|
||||
Object platform = wgInstanceClass.getDeclaredMethod("getPlatform").invoke(instance);
|
||||
Class<?> wgPlatformClass = platform.getClass();
|
||||
|
||||
Object regionContainer = wgPlatformClass.getDeclaredMethod("getRegionContainer").invoke(platform);
|
||||
Class<?> wgRegionContainer = regionContainer.getClass();
|
||||
|
||||
return (RegionManager) wgRegionContainer.getSuperclass()
|
||||
.getMethod("get", com.sk89q.worldedit.world.World.class)
|
||||
.invoke(regionContainer, new BukkitWorld(w));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
return getWorldGuard().getRegionManager(w);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ApplicableRegionSet getApplicableRegionSet(Location loc) {
|
||||
if (getWgVer().contains("7.")) {
|
||||
try {
|
||||
RegionManager mngr = getRegionManager(loc.getWorld());
|
||||
|
||||
Class<?> blockVector3 = Reflection.getClass("com.sk89q.worldedit.math.BlockVector3");
|
||||
if(blockVector3 == null)
|
||||
return null;
|
||||
|
||||
Method applicableRegions = mngr.getClass().getDeclaredMethod("getApplicableRegions", blockVector3);
|
||||
|
||||
Method blockVectorAt = blockVector3.getDeclaredMethod("at", double.class, double.class, double.class);
|
||||
Object blockVector = blockVectorAt.invoke(null, loc.getX(), loc.getY(), loc.getZ());
|
||||
|
||||
Object regionSet = applicableRegions.invoke(mngr, blockVector);
|
||||
|
||||
return (ApplicableRegionSet) regionSet;
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return getRegionManager(loc.getWorld()).getApplicableRegions(new Vector(loc.getX(), loc.getY(), loc.getZ()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getWgVer() {
|
||||
if (wgVerStr == null)
|
||||
wgVerStr = Bukkit.getPluginManager().getPlugin("WorldGuard").getDescription().getVersion();
|
||||
|
||||
return wgVerStr;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,10 +2,9 @@ package nl.iobyte.themepark.commands.subcommands;
|
|||
|
||||
import nl.iobyte.commandapi.CommandFactory;
|
||||
import nl.iobyte.commandapi.arguments.number.IntegerArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class HelpCommand extends SubCommand {
|
||||
|
@ -21,12 +20,8 @@ public class HelpCommand extends SubCommand {
|
|||
.addArgument(new IntegerArgument());
|
||||
}
|
||||
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
//Send CommandSender list of commands it has access to
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
//Send ICommandExecutor list of commands it has access to
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
List<SubCommand> commands = factory.getApplicableSubCommands(sender);
|
||||
if(commands.size() <= 5) {
|
||||
sendSinglePage(sender, commands);
|
||||
|
@ -36,7 +31,7 @@ public class HelpCommand extends SubCommand {
|
|||
sendMultiPage(sender, commands, list, i);
|
||||
}
|
||||
|
||||
private void sendSinglePage(CommandSender sender, List<SubCommand> commands) {
|
||||
private void sendSinglePage(ICommandExecutor sender, List<SubCommand> commands) {
|
||||
sender.sendMessage(Text.color("&f&l>==== &6&lThemePark &l&f====<"));
|
||||
for (SubCommand command : commands)
|
||||
sender.sendMessage(Text.color("&f" + command.getApplicableSyntaxList(sender).get(0).getUsage()));
|
||||
|
@ -44,7 +39,7 @@ public class HelpCommand extends SubCommand {
|
|||
sender.sendMessage(Text.color("&f&l>==== &6&lThemePark &l&f====<"));
|
||||
}
|
||||
|
||||
private void sendMultiPage(CommandSender sender, List<SubCommand> commands, List<Object> list, int i) {
|
||||
private void sendMultiPage(ICommandExecutor sender, List<SubCommand> commands, List<Object> list, int i) {
|
||||
int page = 1;
|
||||
int pages = (int) Math.ceil(((double) commands.size()) / 5);
|
||||
if(i == 1)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package nl.iobyte.themepark.commands.subcommands;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.menuapi.item.ItemBuilder;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.config.ConfigurationManager;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageKey;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class ItemCommand extends SubCommand {
|
|||
.setAllowConsole(false);
|
||||
}
|
||||
|
||||
public void onPlayerCommand(Player player, List<Object> objects, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> objects, int i) {
|
||||
ConfigurationManager manager = ThemePark.getInstance().getAPI().getConfigurationManager();
|
||||
|
||||
Material material = Material.getMaterial(manager.getString(StorageKey.MENU_ITEM_MATERIAL));
|
||||
|
@ -32,12 +32,10 @@ public class ItemCommand extends SubCommand {
|
|||
ItemBuilder builder = new ItemBuilder(material, 1, data);
|
||||
builder.setName(name);
|
||||
|
||||
Player player = (Player) sender.getOriginal();
|
||||
player.getInventory().addItem(builder.getItem());
|
||||
player.updateInventory();
|
||||
player.sendMessage(Text.color("&6&lThemeParkMC &f➢ Added item to your inventory"));
|
||||
}
|
||||
|
||||
//Give CommandSender overview of Plugin status
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> objects, int i) {}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,35 +1,36 @@
|
|||
package nl.iobyte.themepark.commands.subcommands;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.StringArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.config.enums.StorageKey;
|
||||
import nl.iobyte.themepark.api.menu.MenuService;
|
||||
import nl.iobyte.themepark.scheduler.ThemeParkScheduler;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class MenuCommand extends SubCommand {
|
||||
|
||||
public MenuCommand() {
|
||||
super(null, "menu");
|
||||
|
||||
addSyntax("/themepark menu");
|
||||
super(new String[]{"menu"});
|
||||
|
||||
addSyntax("/themepark menu")
|
||||
.addArgument(new StringArgument("status"));
|
||||
.setAllowConsole(false);
|
||||
|
||||
addSyntax("/themepark menu")
|
||||
.addArgument(new StringArgument("status"))
|
||||
.setAllowConsole(false);
|
||||
}
|
||||
|
||||
public void onPlayerCommand(Player player, List<Object> objects, int i) {
|
||||
public void onCommand(ICommandExecutor player, List<Object> objects, int i) {
|
||||
MenuService service = ThemePark.getInstance().getAPI().getMenuService();
|
||||
if(i == 0) {
|
||||
ThemeParkScheduler.runSync(() -> service.getMainMenu().open(player));
|
||||
if(i == 0 && ThemePark.getInstance().getAPI().getConfigurationManager().getBoolean(StorageKey.MENU_ENABLED_MAIN)) {
|
||||
ThemeParkScheduler.runSync(() -> service.getMainMenu().open((Player) player.getOriginal()));
|
||||
return;
|
||||
}
|
||||
|
||||
ThemeParkScheduler.runSync(() -> service.getStatusMenu().open(player));
|
||||
ThemeParkScheduler.runSync(() -> service.getStatusMenu().open((Player) player.getOriginal()));
|
||||
}
|
||||
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> objects, int i) {}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.StringArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionCoverCommand extends SubCommand {
|
||||
|
@ -19,13 +18,7 @@ public class AttractionCoverCommand extends SubCommand {
|
|||
.addArgument(new StringArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
String url = (String) list.get(1);
|
||||
attraction.setCover(url);
|
||||
|
|
|
@ -3,7 +3,7 @@ package nl.iobyte.themepark.commands.subcommands.attraction;
|
|||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.arguments.MessageArgument;
|
||||
import nl.iobyte.commandapi.arguments.StringArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
|
@ -12,7 +12,7 @@ import nl.iobyte.themepark.api.message.Text;
|
|||
import nl.iobyte.themepark.commands.arguments.NoAttractionArgument;
|
||||
import nl.iobyte.themepark.commands.arguments.RegionArgument;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -40,13 +40,7 @@ public class AttractionCreateCommand extends SubCommand {
|
|||
.addArgument(new StringArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
String id = (String) list.get(0);
|
||||
Region region = (Region) list.get(1);
|
||||
String name = (String) list.get(2);
|
||||
|
@ -59,8 +53,8 @@ public class AttractionCreateCommand extends SubCommand {
|
|||
cover = (String) list.get('4');
|
||||
|
||||
Location location = null;
|
||||
if(sender instanceof Player)
|
||||
location = ((Player) sender).getLocation();
|
||||
if(sender.isPlayer())
|
||||
location = ((Player) sender.getOriginal()).getLocation();
|
||||
|
||||
ThemePark.getInstance().getAPI().getAttractionService().addAttraction(new Attraction(
|
||||
id,
|
||||
|
|
|
@ -2,14 +2,13 @@ package nl.iobyte.themepark.commands.subcommands.attraction;
|
|||
|
||||
import com.google.common.collect.Iterables;
|
||||
import nl.iobyte.commandapi.arguments.number.IntegerArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.RegionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -31,13 +30,8 @@ public class AttractionListCommand extends SubCommand {
|
|||
.addArgument(new IntegerArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
int page = 1;
|
||||
String title = "&6&lThemePark";
|
||||
Collection<Attraction> attractions;
|
||||
|
@ -62,7 +56,7 @@ public class AttractionListCommand extends SubCommand {
|
|||
}
|
||||
}
|
||||
|
||||
private void sendSinglePage(CommandSender sender, String title, Collection<Attraction> attractions) {
|
||||
private void sendSinglePage(ICommandExecutor sender, String title, Collection<Attraction> attractions) {
|
||||
sender.sendMessage(Text.color("&f&l>==== &r"+title+" &l&f====<"));
|
||||
if(attractions.isEmpty()) {
|
||||
sender.sendMessage(Text.color("&6No attractions found"));
|
||||
|
@ -78,7 +72,7 @@ public class AttractionListCommand extends SubCommand {
|
|||
sender.sendMessage(Text.color("&f&l>==== &r"+title+" &l&f====<"));
|
||||
}
|
||||
|
||||
private void sendMultiPage(CommandSender sender, int page, String title, Collection<Attraction> attractions) {
|
||||
private void sendMultiPage(ICommandExecutor sender, int page, String title, Collection<Attraction> attractions) {
|
||||
int pages = (int) Math.ceil(((double) attractions.size()) / 5);
|
||||
if(page < 1 || page > pages) {
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ Page &6"+page+" &fdoesn't exist"));
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -18,14 +18,11 @@ public class AttractionLocationCommand extends SubCommand {
|
|||
.setAllowConsole(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
Player player = (Player) sender.getOriginal();
|
||||
attraction.setLocation(player.getLocation());
|
||||
player.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the location of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.MessageArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionNameCommand extends SubCommand {
|
||||
|
@ -19,16 +18,11 @@ public class AttractionNameCommand extends SubCommand {
|
|||
.addArgument(new MessageArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
attraction.setName(name);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import nl.iobyte.themepark.commands.arguments.RegionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionRegionCommand extends SubCommand {
|
||||
|
@ -20,16 +19,11 @@ public class AttractionRegionCommand extends SubCommand {
|
|||
.addArgument(new RegionArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
Region region = (Region) list.get(1);
|
||||
attraction.setRegionID(region.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the region of attraction &f"+attraction.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionRemoveCommand extends SubCommand {
|
||||
|
@ -18,13 +17,7 @@ public class AttractionRemoveCommand extends SubCommand {
|
|||
.addArgument(new AttractionArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
ThemePark.getInstance().getAPI().getAttractionService().removeAttraction(attraction.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully removed attraction &f"+attraction.getID()));
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.event.attraction.AttractionPreStatusChangeEvent;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionStatusCommand extends SubCommand {
|
||||
|
@ -20,16 +21,25 @@ public class AttractionStatusCommand extends SubCommand {
|
|||
.addArgument(new EnumArgument(Status.values()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
Status status = (Status) list.get(1);
|
||||
|
||||
AttractionPreStatusChangeEvent event = new AttractionPreStatusChangeEvent(
|
||||
attraction,
|
||||
attraction.getStatus(),
|
||||
status
|
||||
);
|
||||
ThemePark.getInstance().getAPI().getEventDispatcher().call(
|
||||
event,
|
||||
() -> {
|
||||
if(event.isCancelled())
|
||||
return;
|
||||
|
||||
attraction.setStatus(status);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the status of attraction &f"+attraction.getID()));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.attraction;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.MessageKey;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import nl.iobyte.themepark.scheduler.ThemeParkScheduler;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class AttractionWarpCommand extends SubCommand {
|
||||
|
||||
public AttractionWarpCommand() {
|
||||
super("themepark.admin", "attraction", "warp");
|
||||
super(new String[]{"attraction", "warp"});
|
||||
|
||||
addSyntax("/themepark attraction warp <id>")
|
||||
.addArgument(new AttractionArgument())
|
||||
.setAllowConsole(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Player player = (Player) sender.getOriginal();
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
if(!attraction.getStatus().canTeleport()) {
|
||||
String message = MessageKey.ATTRACTION_TELEPORT_STATUS.getMessage();
|
||||
|
@ -44,7 +44,4 @@ public class AttractionWarpCommand extends SubCommand {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.region;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.MessageArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.NoRegionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegionCreateCommand extends SubCommand {
|
||||
|
@ -20,13 +20,7 @@ public class RegionCreateCommand extends SubCommand {
|
|||
.addArgument(new MessageArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
String id = (String) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
|
||||
|
@ -36,4 +30,5 @@ public class RegionCreateCommand extends SubCommand {
|
|||
));
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully created region &f"+id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,12 +2,11 @@ package nl.iobyte.themepark.commands.subcommands.region;
|
|||
|
||||
import com.google.common.collect.Iterables;
|
||||
import nl.iobyte.commandapi.arguments.number.IntegerArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -22,13 +21,7 @@ public class RegionListCommand extends SubCommand {
|
|||
.addArgument(new IntegerArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Collection<Region> regions = ThemePark.getInstance().getAPI().getAttractionService().getRegions().values();
|
||||
if(regions.size() <= 5) {
|
||||
sendSinglePage(sender, regions);
|
||||
|
@ -37,7 +30,7 @@ public class RegionListCommand extends SubCommand {
|
|||
}
|
||||
}
|
||||
|
||||
private void sendSinglePage(CommandSender sender, Collection<Region> regions) {
|
||||
private void sendSinglePage(ICommandExecutor sender, Collection<Region> regions) {
|
||||
sender.sendMessage(Text.color("&f&l>==== &6&lThemePark &l&f====<"));
|
||||
if(regions.isEmpty()) {
|
||||
sender.sendMessage(Text.color("&6No regions found"));
|
||||
|
@ -49,7 +42,7 @@ public class RegionListCommand extends SubCommand {
|
|||
sender.sendMessage(Text.color("&f&l>==== &6&lThemePark &l&f====<"));
|
||||
}
|
||||
|
||||
private void sendMultiPage(CommandSender sender, Collection<Region> regions, List<Object> list, int i) {
|
||||
private void sendMultiPage(ICommandExecutor sender, Collection<Region> regions, List<Object> list, int i) {
|
||||
int page = 1;
|
||||
int pages = (int) Math.ceil(((double) regions.size()) / 5);
|
||||
if(i == 1)
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.region;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.MessageArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.RegionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class RegionNameCommand extends SubCommand {
|
||||
|
@ -19,16 +18,11 @@ public class RegionNameCommand extends SubCommand {
|
|||
.addArgument(new MessageArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Region region = (Region) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
region.setName(name);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the name of region &f"+region.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.region;
|
||||
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Region;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.RegionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class RegionRemoveCommand extends SubCommand {
|
||||
|
@ -18,15 +17,10 @@ public class RegionRemoveCommand extends SubCommand {
|
|||
.addArgument(new RegionArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Region region = (Region) list.get(0);
|
||||
ThemePark.getInstance().getAPI().getAttractionService().removeRegion(region.getID());
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully removed region &f"+region.getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.ridecount;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.PlayersArgument;
|
||||
import nl.iobyte.commandapi.arguments.number.IntegerArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.themepark.commands.arguments.PlayersArgument;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -22,13 +22,8 @@ public class RideCountAddCommand extends SubCommand {
|
|||
.addArgument(new IntegerArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
List<Player> players = (List<Player>) list.get(1);
|
||||
int amount = (Integer) list.get(2);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package nl.iobyte.themepark.commands.subcommands.ridecount;
|
||||
|
||||
import nl.iobyte.commandapi.arguments.PlayerArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.ThemePark;
|
||||
import nl.iobyte.themepark.api.attraction.objects.Attraction;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import nl.iobyte.themepark.api.ridecount.objects.RideCount;
|
||||
import nl.iobyte.themepark.commands.arguments.AttractionArgument;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.themepark.commands.arguments.PlayerArgument;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,13 +21,8 @@ public class RideCountGetCommand extends SubCommand {
|
|||
.addArgument(new PlayerArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Attraction attraction = (Attraction) list.get(0);
|
||||
Player player = (Player) list.get(1);
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ package nl.iobyte.themepark.commands.subcommands.status;
|
|||
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.arguments.StringArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,13 +19,8 @@ public class StatusColorCommand extends SubCommand {
|
|||
.addArgument(new StringArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Status status = (Status) list.get(0);
|
||||
String color = (String) list.get(1);
|
||||
status.setColor(color);
|
||||
|
|
|
@ -2,10 +2,10 @@ package nl.iobyte.themepark.commands.subcommands.status;
|
|||
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.arguments.StringArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -20,13 +20,8 @@ public class StatusHexColorCommand extends SubCommand {
|
|||
.addArgument(new StringArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Status status = (Status) list.get(0);
|
||||
String hex_color = (String) list.get(1);
|
||||
status.setHexColor(hex_color);
|
||||
|
|
|
@ -2,14 +2,11 @@ package nl.iobyte.themepark.commands.subcommands.status;
|
|||
|
||||
import com.cryptomorin.xseries.XMaterial;
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.arguments.MaterialArgument;
|
||||
import nl.iobyte.commandapi.arguments.number.ShortArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import nl.iobyte.themepark.commands.arguments.MaterialArgument;
|
||||
import java.util.List;
|
||||
|
||||
public class StatusMaterialCommand extends SubCommand {
|
||||
|
@ -20,34 +17,15 @@ public class StatusMaterialCommand extends SubCommand {
|
|||
addSyntax("/themepark status material <status> <material>")
|
||||
.addArgument(new EnumArgument(Status.values()))
|
||||
.addArgument(new MaterialArgument());
|
||||
|
||||
addSyntax("/themepark status material <status> <material> <data>")
|
||||
.addArgument(new EnumArgument(Status.values()))
|
||||
.addArgument(new MaterialArgument())
|
||||
.addArgument(new ShortArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Status status = (Status) list.get(0);
|
||||
XMaterial material;
|
||||
if(i == 0) {
|
||||
material = XMaterial.matchXMaterial((Material) list.get(1));
|
||||
} else {
|
||||
material = XMaterial.matchXMaterial(list.get(1).toString()+":"+list.get(2).toString()).orElse(null);
|
||||
if(material == null) {
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &4Unable to parse specified material:data"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
XMaterial material = (XMaterial) list.get(1);
|
||||
|
||||
status.setMaterial(material);
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the material of status &f"+status.toString()));
|
||||
sender.sendMessage(Text.color("&6&lThemeParkMC &f➢ &aSuccessfully changed the material of status &f"+ status));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@ package nl.iobyte.themepark.commands.subcommands.status;
|
|||
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.arguments.MessageArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,13 +19,8 @@ public class StatusNameCommand extends SubCommand {
|
|||
.addArgument(new MessageArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Status status = (Status) list.get(0);
|
||||
String name = (String) list.get(1);
|
||||
status.setName(name);
|
||||
|
|
|
@ -2,10 +2,10 @@ package nl.iobyte.themepark.commands.subcommands.status;
|
|||
|
||||
import nl.iobyte.commandapi.arguments.BooleanArgument;
|
||||
import nl.iobyte.commandapi.arguments.EnumArgument;
|
||||
import nl.iobyte.commandapi.interfaces.SubCommand;
|
||||
import nl.iobyte.commandapi.objects.SubCommand;
|
||||
import nl.iobyte.themepark.api.attraction.enums.Status;
|
||||
import nl.iobyte.themepark.api.message.Text;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import nl.iobyte.commandapi.interfaces.ICommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,13 +19,8 @@ public class StatusTeleportCommand extends SubCommand {
|
|||
.addArgument(new BooleanArgument());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerCommand(Player player, List<Object> list, int i) {
|
||||
onConsoleCommand(player, list, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConsoleCommand(CommandSender sender, List<Object> list, int i) {
|
||||
public void onCommand(ICommandExecutor sender, List<Object> list, int i) {
|
||||
Status status = (Status) list.get(0);
|
||||
boolean b = (boolean) list.get(1);
|
||||
status.setCanTeleport(b);
|
||||
|
|
|
@ -96,7 +96,7 @@ public class PlayerListener implements Listener {
|
|||
|
||||
e.setCancelled(true);
|
||||
Player player = e.getPlayer();
|
||||
ThemePark.getInstance().getAPI().getMenuService().getMainMenu().open(player);
|
||||
Bukkit.dispatchCommand(player, "themepark menu");
|
||||
}
|
||||
|
||||
//Handle Menu item drop
|
||||
|
|
|
@ -12,6 +12,7 @@ menu:
|
|||
- world_nether
|
||||
- world_the_end
|
||||
main:
|
||||
enabled: true
|
||||
size: 27
|
||||
title: '&6&lThemePark'
|
||||
status:
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
version: 1.0
|
||||
version: 1.1
|
||||
|
||||
prefix: '&6&lThemeParkMC &r&f➢'
|
||||
|
||||
menu:
|
||||
previous: "&6&L\u23F4 Previous"
|
||||
page: "&6Page &f"
|
||||
next: "&6&LNext \u23F5"
|
||||
|
||||
ridecount:
|
||||
add: "{prefix} &aYou have ridden attraction: &f%NAME% &6%AMOUNT%x &afor a total of &6%TOTAL%x"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: ThemePark
|
||||
version: 3.0.0
|
||||
version: 3.0.2
|
||||
author: IOByte
|
||||
website: 'https://www.iobyte.nl'
|
||||
main: nl.iobyte.themepark.ThemePark
|
||||
|
@ -7,3 +7,4 @@ softdepend: [PlaceholderAPI,Train_Carts,Multiverse-Core,MultiWorld]
|
|||
api-version: 1.13
|
||||
commands:
|
||||
themepark:
|
||||
aliases: [tp]
|
|
@ -6,10 +6,9 @@
|
|||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="jdk" jdkName="corretto-11" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
|
@ -20,7 +19,7 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: nl.iobyte:commandapi:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: nl.iobyte:commandapi:1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: nl.iobyte:menuapi:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:2.0.0-alpha1" level="project" />
|
||||
|
@ -40,11 +39,12 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bergerhealer.cloud.commandframework:cloud-core:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bergerhealer.cloud.commandframework:cloud-services:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bergerhealer.cloud.commandframework:cloud-minecraft-extras:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-api:4.3.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-api:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-string:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.8.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-plain:4.3.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-api:4.8.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-key:4.8.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-api:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.10.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:examination-string:1.1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.kyori:adventure-text-serializer-plain:4.8.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.lucko:commodore:1.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.lucko:commodore-file:1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.mojang:brigadier:1.0.17" level="project" />
|
||||
|
@ -76,5 +76,14 @@
|
|||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: classworlds:classworlds:1.1-alpha-2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.cryptomorin:XSeries:8.1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldguard:worldguard-legacy:6.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-bukkit:6.1.5" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-core:6.1.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: rhino:js:1.7R2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.thoughtworks.paranamer:paranamer:2.6" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.lib:jlibnoise:1.0.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q:jchronic:0.2.4a" level="project" />
|
||||
</component>
|
||||
</module>
|
Reference in a new issue