configLines, int lastLineIndentCount) {
-
- int currentIndents = countIndents(index, configLines);
- String key = configLines.get(index).trim().split(":")[0];
-
- if (keyBuilder.length() == 0) {
- keyBuilder.append(key);
- } else if (currentIndents == lastLineIndentCount) {
- //Replace the last part of the key with current key
- removeLastKey(keyBuilder);
-
- if (keyBuilder.length() > 0) {
- keyBuilder.append(".");
- }
-
- keyBuilder.append(key);
- } else if (currentIndents > lastLineIndentCount) {
- //Append current key to the keyBuilder
- keyBuilder.append(".").append(key);
- } else {
- int difference = lastLineIndentCount - currentIndents;
-
- for (int i = 0; i < difference + 1; i++) {
- removeLastKey(keyBuilder);
- }
-
- if (keyBuilder.length() > 0) {
- keyBuilder.append(".");
- }
-
- keyBuilder.append(key);
- }
-
- return currentIndents;
- }
-
- private static String getPrefixSpaces(int indents) {
- return new String(new char[Math.max(0, indents)]).replace("\0", " ");
- }
-
- private static void appendPrefixSpaces(StringBuilder builder, int indents) {
- builder.append(getPrefixSpaces(indents));
- }
-}
\ No newline at end of file
diff --git a/src/main/java/tech/sbdevelopment/v10lift/sbutils/SQLiteDB.java b/src/main/java/tech/sbdevelopment/v10lift/sbutils/SQLiteDB.java
deleted file mode 100644
index 57e659c..0000000
--- a/src/main/java/tech/sbdevelopment/v10lift/sbutils/SQLiteDB.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package tech.sbdevelopment.v10lift.sbutils;
-
-import com.zaxxer.hikari.HikariConfig;
-import com.zaxxer.hikari.HikariDataSource;
-import org.bukkit.Bukkit;
-import tech.sbdevelopment.v10lift.V10LiftPlugin;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Properties;
-
-public class SQLiteDB {
- private final String dbName;
- private HikariDataSource source;
- private Connection con;
-
- /**
- * Initialize a new connection
- *
- * @param dbName The database name
- */
- public SQLiteDB(String dbName) {
- this.dbName = dbName;
-
- File dbFile = new File(V10LiftPlugin.getInstance().getDataFolder(), dbName + ".db");
-
- if (!dbFile.exists()) {
- try {
- Bukkit.getLogger().info("[V10Lift] Generating the " + dbName + ".db!");
- if (!dbFile.createNewFile()) {
- Bukkit.getLogger().severe("[V10Lift] Couldn't generate the " + dbName + ".db!");
- return;
- }
- } catch (IOException e) {
- Bukkit.getLogger().info("[V10Lift] Couldn't generate the " + dbName + ".db!");
- return;
- }
- }
-
- HikariConfig config = new HikariConfig();
- config.setPoolName("V10Lift");
- config.setUsername(null);
- config.setPassword(null);
- config.setDriverClassName("org.sqlite.JDBC");
- config.setConnectionTestQuery("SELECT 1");
- config.setMaximumPoolSize(1);
-
- Properties prop = new Properties();
- prop.setProperty("date_string_format", "yyyy-MM-dd HH:mm:ss");
-
- config.setJdbcUrl("jdbc:sqlite:" + dbFile.getAbsolutePath());
- config.setDataSourceProperties(prop);
- this.source = new HikariDataSource(config);
-
- try {
- this.con = this.source.getConnection();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Get the connection, to execute queries
- *
- * CREATE TABLE - execute()
- * SELECT - executeQuery()
- * UPDATE - executeUpdate()
- *
- * @return Connection
- */
- public Connection getConnection() {
- return this.con;
- }
-
- /**
- * Close the connection
- */
- public void closeSource() {
- Bukkit.getLogger().info("[V10Lift] Closing the database connection for " + dbName + ".db!");
- try {
- this.con.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- this.source.close();
- }
-}
diff --git a/src/main/java/tech/sbdevelopment/v10lift/sbutils/StormSQLiteDB.java b/src/main/java/tech/sbdevelopment/v10lift/sbutils/StormSQLiteDB.java
new file mode 100644
index 0000000..5c345f4
--- /dev/null
+++ b/src/main/java/tech/sbdevelopment/v10lift/sbutils/StormSQLiteDB.java
@@ -0,0 +1,72 @@
+package tech.sbdevelopment.v10lift.sbutils;
+
+import com.craftmend.storm.Storm;
+import com.craftmend.storm.connection.hikaricp.HikariDriver;
+import com.zaxxer.hikari.HikariConfig;
+import com.zaxxer.hikari.HikariDataSource;
+import org.bukkit.plugin.java.JavaPlugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class StormSQLiteDB {
+ private final JavaPlugin plugin;
+ private final String dbName;
+ private final Storm storm;
+
+ /**
+ * Initialize a new database source
+ *
+ * @param dbName The database name
+ */
+ public StormSQLiteDB(JavaPlugin plugin, String dbName) throws SQLException {
+ this.plugin = plugin;
+ this.dbName = dbName;
+
+ File dbFile = new File(plugin.getDataFolder(), dbName + ".db");
+
+ if (!dbFile.exists()) {
+ try {
+ plugin.getLogger().info("Generating the " + dbName + ".db...");
+ if (!dbFile.createNewFile()) {
+ throw new IOException("Couldn't generate the " + dbName + ".db!");
+ }
+ } catch (IOException e) {
+ throw new RuntimeException("Couldn't generate the " + dbName + ".db!", e);
+ }
+ }
+
+ HikariConfig config = new HikariConfig();
+ config.setPoolName(plugin.getName());
+ config.setJdbcUrl("jdbc:sqlite:" + dbFile.getAbsolutePath());
+ config.setUsername(null);
+ config.setPassword(null);
+ config.setDriverClassName("org.sqlite.JDBC");
+ config.setConnectionTestQuery("SELECT 1");
+ config.setMaxLifetime(60000);
+ config.setIdleTimeout(45000);
+ config.setMinimumIdle(10);
+ config.setMaximumPoolSize(50);
+
+ this.storm = new Storm(new HikariDriver(config));
+ }
+
+ /**
+ * Close the connection
+ */
+ public void closeSource() {
+ plugin.getLogger().info("Closing the database connection for " + dbName + ".db...");
+ this.storm.getDriver().close();
+ }
+
+ /**
+ * Get the database connection
+ *
+ * @return The database connection
+ */
+ public Storm getStorm() {
+ return storm;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/tech/sbdevelopment/v10lift/sbutils/UpdateManager.java b/src/main/java/tech/sbdevelopment/v10lift/sbutils/UpdateManager.java
index 04da6fa..6332ac8 100644
--- a/src/main/java/tech/sbdevelopment/v10lift/sbutils/UpdateManager.java
+++ b/src/main/java/tech/sbdevelopment/v10lift/sbutils/UpdateManager.java
@@ -1,6 +1,5 @@
package tech.sbdevelopment.v10lift.sbutils;
-import com.google.gson.JsonParser;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
@@ -12,68 +11,62 @@ import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
-import java.nio.charset.StandardCharsets;
import java.util.function.BiConsumer;
/**
- * Update class for SBDevelopment
+ * Update checker class
*
* @author Stijn [SBDeveloper]
- * @version 2.1 [19-11-2021] - This class supports both the v2 Spiget and v2 SBDUpdate API
- *
- *
© Stijn Bannink [stijnbannink23@gmail.com] - All rights reserved.
* @since 05-03-2020
+ * @version 2.2 [17-04-2022] - Added Polymart support
*/
public class UpdateManager {
- private static final JsonParser parser = new JsonParser();
-
- private static final String SPIGOT_API = "https://api.spiget.org/v2/resources/%s/versions/latest";
+ private static final String SPIGOT_API = "https://api.spigotmc.org/legacy/update.php?resource=%d";
private static final String SPIGOT_DOWNLOAD = "https://api.spiget.org/v2/resources/%s/download";
- private static final String SBDPLUGINS_API = "https://updates.sbdplugins.nl/api/v2/plugins/%d";
- private static final String SBDPLUGINS_DOWNLOAD = "https://updates.sbdplugins.nl/api/v2/download/%d";
+ private static final String POLYMART_API = "https://api.polymart.org/v1/getResourceInfoSimple/?resource_id=%d&key=version";
+ private static final String POLYMART_DOWNLOAD = "https://api.polymart.org/v1/requestUpdateURL/?inject_version=%d&resource_id=%d&user_id=%d&nonce=%d&download_agent=%d&download_time=%d&download_token=%s";
private final Plugin plugin;
private final Version currentVersion;
- private final int resourceID;
private final CheckType type;
- private final String license;
+
+ //Spigot & Polymart
+ private final int resourceID;
+
+ //Polymart only
+ private int injector_version;
+ private int user_id;
+ private int nonce;
+ private int download_agent;
+ private int download_time;
+ private String download_token;
private BiConsumer versionResponse;
private BiConsumer downloadResponse;
/**
- * Construct a new UpdateManager for Spigot
+ * Construct a new UpdateManager
*
- * @param plugin The javaplugin (Main class)
- * @param resourceID The resourceID on spigot/sbdplugins
+ * @param plugin The plugin instance
*/
- public UpdateManager(Plugin plugin, int resourceID) {
+ public UpdateManager(Plugin plugin, CheckType type) {
this.plugin = plugin;
this.currentVersion = new Version(plugin.getDescription().getVersion());
- this.resourceID = resourceID;
- this.type = CheckType.SPIGOT;
- this.license = null;
- }
-
- /**
- * Construct a new UpdateManager for SBDPlugins
- *
- * @param plugin The javaplugin (Main class)
- * @param resourceID The resourceID on spigot/sbdplugins
- * @param license The license for the download
- */
- public UpdateManager(Plugin plugin, int resourceID, String license) {
- this.plugin = plugin;
- this.currentVersion = new Version(plugin.getDescription().getVersion());
- this.resourceID = resourceID;
- this.type = CheckType.SBDPLUGINS;
- this.license = license;
+ this.type = type;
+ this.resourceID = Integer.parseInt("%%__RESOURCE__%%");
+ if (type == CheckType.POLYMART_PAID) {
+ this.injector_version = Integer.parseInt("%%__INJECT_VER__%%");
+ this.user_id = Integer.parseInt("%%__USER__%%");
+ this.nonce = Integer.parseInt("%%__NONCE__%%");
+ this.download_agent = Integer.parseInt("%%__AGENT__%%");
+ this.download_time = Integer.parseInt("%%__TIMESTAMP__%%");
+ this.download_token = "%%__VERIFY_TOKEN__%%";
+ }
}
/**
* Handle the response given by check();
- *
* @param versionResponse The response
* @return The updatemanager
*/
@@ -93,23 +86,16 @@ public class UpdateManager {
public void check() {
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
try {
- BufferedReader in = null;
- if (type == CheckType.SPIGOT) {
- HttpsURLConnection con = (HttpsURLConnection) new URL(String.format(SPIGOT_API, this.resourceID)).openConnection();
- con.setRequestMethod("GET");
- con.setRequestProperty("User-Agent", "Mozilla/5.0");
-
- in = new BufferedReader(new InputStreamReader(con.getInputStream()));
- } else if (type == CheckType.SBDPLUGINS) {
- HttpsURLConnection con = (HttpsURLConnection) new URL(String.format(SBDPLUGINS_API, this.resourceID)).openConnection();
- con.setRequestMethod("GET");
- con.setRequestProperty("User-Agent", "Mozilla/5.0");
-
- in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+ HttpsURLConnection con;
+ if (type == CheckType.POLYMART_PAID) {
+ con = (HttpsURLConnection) new URL(String.format(POLYMART_API, this.resourceID)).openConnection();
+ } else {
+ con = (HttpsURLConnection) new URL(String.format(SPIGOT_API, this.resourceID)).openConnection();
}
+ con.setRequestMethod("GET");
+ con.setRequestProperty("User-Agent", "SBDChecker/2.1");
- if (in == null) return;
-
+ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
@@ -117,10 +103,7 @@ public class UpdateManager {
}
in.close();
- String version = parser.parse(response.toString()).getAsJsonObject().get(type == CheckType.SPIGOT ? "name" : "version").getAsString();
- if (version == null) return;
-
- Version onlineVersion = new Version(version);
+ Version onlineVersion = new Version(response.toString());
VersionResponse verRes = this.currentVersion.check(onlineVersion);
@@ -153,35 +136,16 @@ public class UpdateManager {
ReadableByteChannel channel;
try {
//https://stackoverflow.com/questions/921262/how-to-download-and-save-a-file-from-internet-using-java
- int response;
- InputStream stream;
HttpsURLConnection connection;
- if (type == CheckType.SBDPLUGINS) {
- connection = (HttpsURLConnection) new URL(String.format(SBDPLUGINS_DOWNLOAD, this.resourceID)).openConnection();
-
- String urlParameters = "license=" + license + "&port=" + Bukkit.getPort();
- byte[] postData = urlParameters.getBytes(StandardCharsets.UTF_8);
- int postDataLength = postData.length;
-
- connection.setRequestMethod("GET");
- connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- connection.setRequestProperty("charset", "utf-8");
- connection.setRequestProperty("Content-Length", Integer.toString(postDataLength));
- connection.setRequestProperty("User-Agent", "Mozilla/5.0");
- connection.setDoOutput(true);
-
- DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
- wr.write(postData);
- wr.close();
+ if (type == CheckType.POLYMART_PAID) {
+ connection = (HttpsURLConnection) new URL(String.format(POLYMART_DOWNLOAD, this.injector_version, this.resourceID, this.user_id, this.nonce, this.download_agent, this.download_time, this.download_token)).openConnection();
} else {
connection = (HttpsURLConnection) new URL(String.format(SPIGOT_DOWNLOAD, this.resourceID)).openConnection();
- connection.setRequestProperty("User-Agent", "Mozilla/5.0");
}
+ connection.setRequestProperty("User-Agent", "Mozilla/5.0");
- response = connection.getResponseCode();
- stream = connection.getInputStream();
-
- if (response != 200) {
+ InputStream stream = connection.getInputStream();
+ if (connection.getResponseCode() != 200) {
BufferedReader in = new BufferedReader(new InputStreamReader(stream));
String inputLine;
@@ -191,7 +155,7 @@ public class UpdateManager {
}
in.close();
- throw new RuntimeException("Download returned status #" + response, new Throwable(responsestr.toString()));
+ throw new RuntimeException("Download returned status #" + connection.getResponseCode(), new Throwable(responsestr.toString()));
}
channel = Channels.newChannel(stream);
@@ -234,9 +198,7 @@ public class UpdateManager {
}
private File getPluginFile() {
- if (!(this.plugin instanceof JavaPlugin)) {
- return null;
- }
+ if (!(this.plugin instanceof JavaPlugin)) { return null; }
try {
Method method = JavaPlugin.class.getDeclaredMethod("getFile");
method.setAccessible(true);
@@ -246,8 +208,8 @@ public class UpdateManager {
}
}
- private enum CheckType {
- SPIGOT, SBDPLUGINS
+ public enum CheckType {
+ SPIGOT, POLYMART_PAID
}
public enum VersionResponse {
@@ -265,18 +227,18 @@ public class UpdateManager {
private final String version;
- private Version(String version) {
- if (version == null)
- throw new IllegalArgumentException("Version can not be null");
- if (!version.matches("[0-9]+(\\.[0-9]+)*"))
- throw new IllegalArgumentException("Invalid version format");
- this.version = version;
- }
-
public final String get() {
return this.version;
}
+ private Version(String version) {
+ if(version == null)
+ throw new IllegalArgumentException("Version can not be null");
+ if(!version.matches("[0-9]+(\\.[0-9]+)*"))
+ throw new IllegalArgumentException("Invalid version format");
+ this.version = version;
+ }
+
private VersionResponse check(Version that) {
String[] thisParts = this.get().split("\\.");
String[] thatParts = that.get().split("\\.");
@@ -285,12 +247,12 @@ public class UpdateManager {
for (int i = 0; i < length; i++) {
int thisPart = i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;
int thatPart = i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;
- if (thisPart < thatPart)
+ if(thisPart < thatPart)
return VersionResponse.FOUND_NEW;
- if (thisPart > thatPart)
+ if(thisPart > thatPart)
return VersionResponse.THIS_NEWER;
}
return VersionResponse.LATEST;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/tech/sbdevelopment/v10lift/utils/ConfigUtil.java b/src/main/java/tech/sbdevelopment/v10lift/utils/ConfigUtil.java
index 1cc90e9..c7c4432 100644
--- a/src/main/java/tech/sbdevelopment/v10lift/utils/ConfigUtil.java
+++ b/src/main/java/tech/sbdevelopment/v10lift/utils/ConfigUtil.java
@@ -26,14 +26,14 @@ public class ConfigUtil {
}
/**
- * Send a message from the messages.yml without variables
+ * Send a message from the lang_en.yml without variables
*
* @param p The commandsender to send it to
* @param path The path to look for
*/
public static void sendMessage(CommandSender p, @Nonnull String path) {
if (V10LiftPlugin.getMessages().getFile().get(path) == null) {
- throw new NullPointerException("Message " + path + " not found in messages.yml!");
+ throw new NullPointerException("Message " + path + " not found in lang_en.yml!");
}
if (V10LiftPlugin.getMessages().getFile().isList(path)) {
@@ -48,7 +48,7 @@ public class ConfigUtil {
}
/**
- * Get a message from the messages.yml with variables
+ * Get a message from the lang_en.yml with variables
*
* @param p The commandsender to send it to
* @param path The path to look for
@@ -56,7 +56,7 @@ public class ConfigUtil {
*/
public static void sendMessage(CommandSender p, @Nonnull String path, Map replacement) {
if (V10LiftPlugin.getMessages().getFile().get(path) == null) {
- throw new NullPointerException("Message " + path + " not found in messages.yml!");
+ throw new NullPointerException("Message " + path + " not found in lang_en.yml!");
}
if (V10LiftPlugin.getMessages().getFile().isList(path)) {
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 8ce27e2..d2f4f5c 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -1,3 +1,6 @@
+# The language to use for the messages
+Locale: en
+
# Generic sign texts
SignText: "[v10lift]"
DefectText: "&kDefect!"
diff --git a/src/main/resources/locale/lang_en.yml b/src/main/resources/locale/lang_en.yml
new file mode 100644
index 0000000..2bab2fe
--- /dev/null
+++ b/src/main/resources/locale/lang_en.yml
@@ -0,0 +1,147 @@
+v10lift:
+ general:
+ nopermission: '&cYou don''t have the permission to do this.'
+ playeronly: '&cOnly players can do this.'
+ incorrectusage: '&cPlease use %Command% instead'
+ internalerror: '&cSomething went wrong internally.'
+ doesntexists: '&cThere are no lifts with that name.'
+ alreadyexists: '&cA lift with that name already exists.'
+ switchonedit: '&cEnable editor mode before doing this.'
+ detectionfailed: '&cAutomatic floor detection failed!'
+ floordoesntexists: '&cThe floor %Name% doesn''t exists!'
+ nowhitelistpermission: '&cYou can''t go to that floor!'
+ nofloors: '&cThis elevator has no floors!'
+ removeliftfirst: '&cYou can''t do this! Remove the lift first.'
+ removeropefirst: '&cYou can''t do this! Remove the rope first.'
+ removedoorfirst: '&cYou can''t do this! Remove the door first.'
+ create:
+ addblocks: >
+ &aOkay, now add all the blocks from the cab by right-clicking them.
+ &awhen finished, type: /v10lift create
+ noblocks: '&cYou must add blocks first.'
+ created: '&aSuccessfully created lift %Name%.'
+ delete:
+ notremoved: '&cThe lift %Name% couldn''t be removed.'
+ removed: '&aSuccessfully removed lift %Name%.'
+ rename:
+ renamed: '&aLift successfully renamed!'
+ edit:
+ stillineditmode: '&cYou are still in editor mode.'
+ turnedon: '&aEnabled editor.'
+ turnedoff: '&aDisabled editor.'
+ floor:
+ tohigh: '&cThat floor is too high!'
+ alreadyexists: '&cThat floor already exists!'
+ doesntexists: '&cThat floor doesn''t exists!'
+ added: '&aFloor successfully added!'
+ removed: '&aFloor successfully removed!'
+ renamed: '&aFloor successfully renamed!'
+ input:
+ stilladjusting: '&cYou are still adjusting an input!'
+ nothingtoremove: '&cThere is no input to remove!'
+ alreadyadded: '&cThis block has already been chosen as an input. Choose another block!'
+ noinput: '&cThis block is not an input. Choose another block!'
+ rightclick: '&aNow right click on the input block!'
+ created: '&aInput created!'
+ removed: '&aInput removed!'
+ offlineinput:
+ stilladjusting: '&cYou are still adjusting an offline input!'
+ nothingtoremove: '&cThere is no offline input to remove!'
+ alreadyadded: '&cThis block has already been chosen as an offline input. Choose another block!'
+ noinput: '&cThis block is not an offline input. Choose another block!'
+ rightclick: '&aNow right click on the offline input block!'
+ created: '&aOffline input created!'
+ removed: '&aOffline input removed!'
+ build:
+ disabled: '&aConstruction mode disabled!'
+ enabled: >
+ &aNow right-click on the elevator blocks!
+ &aThen do /v10lift build to save it!
+ blockadded: '&aBlock added to the elevator.'
+ blockremoved: '&6Block removed from the elevator.'
+ blacklistedmaterial: '&cThe material %Name% cannot be used!'
+ noselection: '&cYou must select a region with the WorldEdit wand first!'
+ unsupportedselection: '&cThe selection must be cuboid or polygonal!'
+ blocksadded: '&aBlocks added to the elevator.'
+ blocksfailed: '&cNot all blocks could be added to the elevator. Failure amount: %Failed%'
+ worldeditnotenabled: '&cWorldEdit is not enabled on this server!'
+ rope:
+ stilladjusting: '&cYou are still adjusting a rope.'
+ onlyup: '&cA rope can only go up!'
+ onlyonematerial: '&cThe rope must be of the same material!'
+ alreadyarope: '&cPart of the rope is already part of another rope!'
+ notarope: '&cThis block is not part of the rope.'
+ blacklistedmaterial: '&cThe rope is built of blacklisted blocks!'
+ add: '&aNow right-click on the beginning and the end of the rope.'
+ delete: '&aNow right-click on the rope.'
+ clickonend: '&6Now right-click on the end of the rope!'
+ partremoved: >
+ &6Start removed!
+ &6Now right-click on the end of the rope!
+ created: '&aRope created.'
+ removed: '&aRope removed.'
+ door:
+ blacklistedmaterial: '&cThe material %Name% is currently not supported!'
+ disabled: '&aDoor editor mode disabled!'
+ enabled: >
+ &aNow right-click on the door blocks! (If they are real doors, click on the bottom block)
+ &aThen do /v10lift door to save it.
+ created: '&aDoor created.'
+ removed: '&6Door removed.'
+ whitelist:
+ group:
+ vaultnotfound: '&cYou can''t add a group when Vault is not found.'
+ notfound: '&cThe group %Name% is not found.'
+ alreadycontains: '&cThe whitelist already contains this group!'
+ doesntcontains: '&cThe whitelist doesn''t contain this group!'
+ added: '&aGroup added to whitelist!'
+ removed: '&aGroup removed from whitelist!'
+ player:
+ notfound: '&cThe player %Name% could not be found.'
+ alreadycontains: '&cThis user is already on the whitelist'
+ doesntcontains: '&cThis user isn''t on the whitelist'
+ added: '&aUser added to whitelist!'
+ removed: '&aUser removed from whitelist!'
+ whois:
+ usewithoutname: '&cYou need to be a player to use this command without a name.'
+ notalift: '&cThis block is not part of a lift.'
+ withoutname: '&aNow right-click on the block you want to check.'
+ speed:
+ wrongspeed: '&cThe speed %Speed% is incorrect.'
+ changed: '&aUpdated lift speed!'
+ sound:
+ turnedon: '&aSounds are now turned on!'
+ turnedoff: '&aSounds are now turned off!'
+ realistic:
+ turnedon: '&aRealistic mode turned on!'
+ turnedoff: '&aRealistic mode turned off!'
+ disable:
+ alreadydefective: '&cThis lift is already defective!'
+ disabled: '&aLift disabled!'
+ repair:
+ notdefective: '&cThis lift isn''t defective!'
+ itemsneeded: '&cYou need %Amount%x %ItemName%!'
+ repaired: '&aYou successfully repaired the lift!'
+ abort:
+ nothingtocancel: '&cOops! You can''t cancel anything.'
+ cancelled: '&6Cancelled.'
+ reload:
+ reloaded: '&6Plugin reloaded successfully!'
+ start:
+ nonplayer: '&cPlease give a name as a non-player!'
+ started: '&aLift %Name% started.'
+ stop:
+ nonplayer: '&cPlease give a name as a non-player!'
+ nomovingtasks: '&cLift %Name% doesn''t contain any moving tasks!'
+ started: '&aLift %Name% stopped.'
+ liftsign:
+ noname: '&cNo lift name given!'
+ created: '&aLift sign created!'
+ removed: '&6Lift sign removed!'
+ list:
+ nolifts: '&cThere are no lifts!'
+ header: '&6Lifts:'
+ lift: '&6- %Name%'
+ setoffline:
+ disabled: '&aThe lift is now offline!'
+ enabled: '&aThe lift is now online!'
\ No newline at end of file
diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml
deleted file mode 100644
index ad600fd..0000000
--- a/src/main/resources/messages.yml
+++ /dev/null
@@ -1,175 +0,0 @@
-General:
- NoPermission: '&cYou don''t have the permission to do this.'
- PlayerOnly: '&cOnly players can do this.'
- IncorrectUsage: '&cPlease use %Command% instead'
- InternalError: '&cSomething went wrong internally.'
-
- DoesntExists: '&cThere are no lifts with that name.'
- AlreadyExists: '&cA lift with that name already exists.'
- SwitchOnEdit: '&cEnable editor mode before doing this.'
- DetectionFailed: '&cAutomatic floor detection failed!'
- FloorDoesntExists: '&cThe floor %Name% doesn''t exists!'
-
- NoWhitelistPermission: '&cYou can''t go to that floor!'
- NoFloors: '&cThis elevator has no floors!'
-
- RemoveLiftFirst: '&cYou can''t do this! Remove the lift first.'
- RemoveRopeFirst: '&cYou can''t do this! Remove the rope first.'
- RemoveDoorFirst: '&cYou can''t do this! Remove the door first.'
-
-Create:
- AddBlocks: |-
- &aOkay, now add all the blocks from the cab by right-clicking them.
- &awhen finished, type: /v10lift create
- NoBlocks: '&cYou must add blocks first.'
- Created: '&aSuccessfully created lift %Name%.'
-
-Delete:
- NotRemoved: '&cThe lift %Name% couldn''t be removed.'
- Removed: '&aSuccessfully removed lift %Name%.'
-
-Rename:
- Renamed: '&aLift successfully renamed!'
-
-Edit:
- StillInEditMode: '&cYou are still in editor mode.'
- TurnedOn: '&aEnabled editor.'
- TurnedOff: '&aDisabled editor.'
-
-Floor:
- ToHigh: '&cThat floor is too high!'
- AlreadyExists: '&cThat floor already exists!'
- DoesntExists: '&cThat floor doesn''t exists!'
- Added: '&aFloor successfully added!'
- Removed: '&aFloor successfully removed!'
- Renamed: '&aFloor successfully renamed!'
-
-Input:
- StillAdjusting: '&cYou are still adjusting an input!'
- NothingToRemove: '&cThere is no input to remove!'
- AlreadyAdded: '&cThis block has already been chosen as an input. Choose another
- block!'
- NoInput: '&cThis block is not an input. Choose another block!'
- RightClick: '&aNow right click on the input block!'
- Created: '&aInput created!'
- Removed: '&aInput removed!'
-
-OfflineInput:
- StillAdjusting: '&cYou are still adjusting an offline input!'
- NothingToRemove: '&cThere is no offline input to remove!'
- AlreadyAdded: '&cThis block has already been chosen as an offline input. Choose
- another block!'
- NoInput: '&cThis block is not an offline input. Choose another block!'
- RightClick: '&aNow right click on the offline input block!'
- Created: '&aOffline input created!'
- Removed: '&aOffline input removed!'
-
-Build:
- Disabled: '&aConstruction mode disabled!'
- Enabled: |-
- &aNow right-click on the elevator blocks!
- &aThen do /v10lift build to save it!
- BlockAdded: '&aBlock added to the elevator.'
- BlockRemoved: '&6Block removed from the elevator.'
- BlacklistedMaterial: '&cThe material %Name% cannot be used!'
- NoSelection: '&cYou must select a region with the WorldEdit wand first!'
- UnsupportedSelection: '&cThe selection must be cuboid or polygonal!'
- BlocksAdded: '&aBlocks added to the elevator.'
- BlocksFailed: '&cNot all blocks could be added to the elevator. Failure amount: %Failed%'
- WorldEditNotEnabled: '&cWorldEdit is not enabled on this server!'
-
-Rope:
- StillAdjusting: '&cYou are still adjusting a rope.'
- OnlyUp: '&cA rope can only go up!'
- OnlyOneMaterial: '&cThe rope must be of the same material!'
- AlreadyARope: '&cPart of the rope is already part of another rope!'
- NotARope: '&cThis block is not part of the rope.'
- BlacklistedMaterial: '&cThe rope is build of blacklisted blocks!'
- Add: '&aNow right-click on the beginning and the end of the rope.'
- Delete: '&aNow right-click on the rope.'
- ClickOnEnd: '&6Now right-click on the end of the rope!'
- PartRemoved: |-
- &6Start removed!
- &6Now right-click on the end of the rope!
- Created: '&aRope created.'
- Removed: '&aRope removed.'
-
-Door:
- BlacklistedMaterial: '&cThe material %Name% is currently not supported!'
- Disabled: '&aDoor editor mode disabled!'
- Enabled: |-
- &aNow right-click on the door blocks! (If it are real doors, click on the bottom block)
- &aThen do /v10lift door to save it.
- Created: '&aDoor created.'
- Removed: '&6Door removed.'
-
-Whitelist:
- Group:
- VaultNotFound: '&cYou can''t add a group when Vault is not found.'
- NotFound: '&cThe group %Name% is not found.'
- AlreadyContains: '&cThe whitelist already contains this group!'
- DoesntContains: '&cThe whitelist doesn''t contain this group!'
- Added: '&aGroup added to whitelist!'
- Removed: '&aGroup removed from whitelist!'
- Player:
- NotFound: '&cThe player %Name% could not be found.'
- AlreadyContains: '&cThis user is already on the whitelist'
- DoesntContains: '&cThis user isn''t on the whitelist'
- Added: '&aUser added to whitelist!'
- Removed: '&aUser removed from whitelist!'
-
-Whois:
- UseWithoutName: '&cYou need to be a player to use this command without name.'
- NotALift: '&cThis block is not part of a lift.'
- WithoutName: '&aNow right-click on the block you want to check.'
-
-Speed:
- WrongSpeed: '&cThe speed %Speed% is incorrect.'
- Changed: '&aUpdated lift speed!'
-
-Sound:
- TurnedOn: '&aSounds are now turned on!'
- TurnedOff: '&aSounds are now turned off!'
-
-Realistic:
- TurnedOn: '&aRealistic mode turned on!'
- TurnedOff: '&aRealistic mode turned off!'
-
-Disable:
- AlreadyDefective: '&cThis lift is already defective!'
- Disabled: '&aLift disabled!'
-
-Repair:
- NotDefective: '&cThis lift isn''t defective!'
- ItemsNeeded: '&cYou need %Amount%x %ItemName%!'
- Repaired: '&aYou successfully repaired the lift!'
-
-Abort:
- NothingToCancel: '&cOops! You can''t cancel anything.'
- Cancelled: '&6Cancelled.'
-
-Reload:
- Reloaded: '&6Plugin reloaded successfully!'
-
-Start:
- NonPlayer: '&cPlease give a name as non-player!'
- Started: '&aLift %Name% started.'
-
-Stop:
- NonPlayer: '&cPlease give a name as non-player!'
- NoMovingTasks: '&cLift %Name% doesn''t contain any movingtasks!'
- Started: '&aLift %Name% stopped.'
-
-LiftSign:
- NoName: '&cNo lift name given!'
- Created: '&aLift sign created!'
- Removed: '&6Lift sign removed!'
-
-List:
- NoLifts: '&cThere are no lifts!'
- Header: '&6Lifts:'
- Lift: '&6- %Name%'
-
-SetOffline:
- Disabled: '&aThe lift is now offline!'
- Enabled: '&aThe lift is now online!'
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 1316ce0..379cba8 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -3,27 +3,4 @@ main: tech.sbdevelopment.v10lift.V10LiftPlugin
version: ${project.version}
api-version: "1.13"
author: SBDeveloper
-softdepend: ["Vault", "WorldEdit"]
-commands:
- v10lift:
- description: The V10Lift Command
-permissions:
- v10lift.admin:
- description: The full power admin permission
- default: op
- v10lift.build:
- description: The permission to build a lift
- v10lift.reload:
- description: Reload the plugin
- v10lift.repair:
- description: Repair a lift
- v10lift.disable:
- description: Disable a lift
- v10lift.start:
- description: Start a lift
- v10lift.stop:
- description: Stop a lift
- v10lift.list:
- description: List all lifts
- v10lift.setoffline:
- description: Set a lift offline / online
\ No newline at end of file
+softdepend: ["Vault", "WorldEdit"]
\ No newline at end of file