From cd1a8dd166a004cbd1b0663a43238810eabd5355 Mon Sep 17 00:00:00 2001
From: Ghost_chu <2908803755@qq.com>
Date: Sun, 16 Feb 2020 15:33:26 +0800
Subject: [PATCH] update
Former-commit-id: 43b2f16457dc3b4086f23c55e4f022f7a758a7d4
---
pom.xml | 16 +-
.../org/maxgamer/quickshop/File/JSONFile.java | 58 --
.../org/maxgamer/quickshop/File/YAMLFile.java | 55 --
.../{File => FilePortlek}/FileEnvelope.java | 45 +-
.../{File => FilePortlek}/IFile.java | 74 +-
.../quickshop/FilePortlek/JSONFile.java | 37 +
.../quickshop/FilePortlek/YAMLFile.java | 36 +
.../org/maxgamer/quickshop/Util/MsgUtil.java | 32 +-
src/main/resources/config.yml | 5 +-
.../quickshop/File/FileEnvelopeTest.java | 769 ------------------
.../org/maxgamer/quickshop/QuickShopTest.java | 32 -
src/test/resources/messages.json | 231 ------
src/test/resources/messages.yml | 234 ------
src/test/resources/plugin.yml | 3 -
14 files changed, 157 insertions(+), 1470 deletions(-)
delete mode 100644 src/main/java/org/maxgamer/quickshop/File/JSONFile.java
delete mode 100644 src/main/java/org/maxgamer/quickshop/File/YAMLFile.java
rename src/main/java/org/maxgamer/quickshop/{File => FilePortlek}/FileEnvelope.java (90%)
rename src/main/java/org/maxgamer/quickshop/{File => FilePortlek}/IFile.java (75%)
create mode 100644 src/main/java/org/maxgamer/quickshop/FilePortlek/JSONFile.java
create mode 100644 src/main/java/org/maxgamer/quickshop/FilePortlek/YAMLFile.java
delete mode 100644 src/test/java/org/maxgamer/quickshop/File/FileEnvelopeTest.java
delete mode 100644 src/test/java/org/maxgamer/quickshop/QuickShopTest.java
delete mode 100644 src/test/resources/messages.json
delete mode 100644 src/test/resources/messages.yml
delete mode 100644 src/test/resources/plugin.yml
diff --git a/pom.xml b/pom.xml
index 126c2b8cf..e903d3689 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
org.maxgamer
QuickShop
- 3.1.4
+ 3.1.4.1
@@ -94,10 +94,6 @@
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
@@ -226,7 +222,7 @@
OpenInv
3.3.0
system
- ${project.basedir}/lib/OpenInv.jar
+ ${basedir}/lib/OpenInv.jar
org.projectlombok
@@ -258,7 +254,7 @@
clearlag
3.0.6
system
- ${project.basedir}/lib/Clearlag.jar
+ ${basedir}/lib/Clearlag.jar
me.lucko.luckperms
@@ -276,7 +272,7 @@
org.junit.jupiter
junit-jupiter
- 5.6.0
+ RELEASE
test
@@ -302,7 +298,7 @@
Towny
0.95.2.8
system
- ${project.basedir}/lib/Towny-0.95.2.8.jar
+ ${basedir}/lib/Towny-0.95.2.8.jar
com.sk89q.worldguard
@@ -327,7 +323,7 @@
Residence
4.4.8.2
system
- ${project.basedir}/lib/Residence4.8.8.2.jar
+ ${basedir}/lib/Residence4.8.8.2.jar
com.massivecraft
diff --git a/src/main/java/org/maxgamer/quickshop/File/JSONFile.java b/src/main/java/org/maxgamer/quickshop/File/JSONFile.java
deleted file mode 100644
index 7319352fa..000000000
--- a/src/main/java/org/maxgamer/quickshop/File/JSONFile.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.maxgamer.quickshop.File;
-
-import java.io.File;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import org.bukkit.plugin.Plugin;
-import org.jetbrains.annotations.NotNull;
-import org.maxgamer.quickshop.NonQuickShopStuffs.com.dumbtruckman.JsonConfiguration.JSONConfiguration;
-
-public final class JSONFile extends FileEnvelope {
-
- public JSONFile(
- @NotNull final Plugin plugin,
- @NotNull final File file,
- @NotNull final String resourcePath,
- boolean loadDefault) {
- super(
- plugin,
- file,
- resourcePath.endsWith(".json") ? resourcePath : resourcePath + ".json",
- loadDefault);
- }
-
- public JSONFile(
- @NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath) {
- super(
- plugin, file, resourcePath.endsWith(".json") ? resourcePath : resourcePath + ".json", true);
- }
-
- public JSONFile(
- @NotNull final Plugin plugin,
- @NotNull final String resourcePath,
- @NotNull final String fileName) {
- this(
- plugin,
- new File(
- plugin.getDataFolder().getAbsolutePath()
- + (resourcePath.startsWith("/") ? resourcePath : "/" + resourcePath),
- fileName.endsWith(".json") ? fileName : fileName + ".json"),
- resourcePath.isEmpty()
- ? fileName
- : resourcePath.endsWith("/") ? resourcePath + fileName : resourcePath + "/" + fileName);
- }
-
- public JSONFile(@NotNull final Plugin plugin, @NotNull final String fileName) {
- this(plugin, "", fileName);
- }
-
- @Override
- public void reload() {
- fileConfiguration = JSONConfiguration.loadConfiguration(file);
- if (loadDefault) {
- fileConfiguration.setDefaults(
- JSONConfiguration.loadConfiguration(
- new InputStreamReader(getInputStream(), StandardCharsets.UTF_8)));
- }
- }
-}
diff --git a/src/main/java/org/maxgamer/quickshop/File/YAMLFile.java b/src/main/java/org/maxgamer/quickshop/File/YAMLFile.java
deleted file mode 100644
index 83c4013fa..000000000
--- a/src/main/java/org/maxgamer/quickshop/File/YAMLFile.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.maxgamer.quickshop.File;
-
-import java.io.File;
-import java.io.InputStreamReader;
-import org.bukkit.configuration.file.YamlConfiguration;
-import org.bukkit.plugin.Plugin;
-import org.jetbrains.annotations.NotNull;
-
-public final class YAMLFile extends FileEnvelope {
-
- public YAMLFile(
- @NotNull final Plugin plugin,
- @NotNull final File file,
- @NotNull final String resourcePath,
- boolean loadDefault) {
- super(
- plugin,
- file,
- resourcePath.endsWith(".yml") ? resourcePath : resourcePath + ".yml",
- loadDefault);
- }
-
- public YAMLFile(
- @NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath) {
- super(plugin, file, resourcePath.endsWith(".yml") ? resourcePath : resourcePath + ".yml", true);
- }
-
- public YAMLFile(
- @NotNull final Plugin plugin,
- @NotNull final String resourcePath,
- @NotNull final String fileName) {
- this(
- plugin,
- new File(
- plugin.getDataFolder().getAbsolutePath()
- + (resourcePath.startsWith("/") ? resourcePath : "/" + resourcePath),
- fileName.endsWith(".yml") ? fileName : fileName + ".yml"),
- resourcePath.isEmpty()
- ? fileName
- : resourcePath.endsWith("/") ? resourcePath + fileName : resourcePath + "/" + fileName);
- }
-
- public YAMLFile(@NotNull final Plugin plugin, @NotNull final String fileName) {
- this(plugin, "", fileName);
- }
-
- @Override
- public void reload() {
- fileConfiguration = YamlConfiguration.loadConfiguration(file);
- if (loadDefault) {
- fileConfiguration.setDefaults(
- YamlConfiguration.loadConfiguration(new InputStreamReader(getInputStream())));
- }
- }
-}
diff --git a/src/main/java/org/maxgamer/quickshop/File/FileEnvelope.java b/src/main/java/org/maxgamer/quickshop/FilePortlek/FileEnvelope.java
similarity index 90%
rename from src/main/java/org/maxgamer/quickshop/File/FileEnvelope.java
rename to src/main/java/org/maxgamer/quickshop/FilePortlek/FileEnvelope.java
index 5120859c2..770e21413 100644
--- a/src/main/java/org/maxgamer/quickshop/File/FileEnvelope.java
+++ b/src/main/java/org/maxgamer/quickshop/FilePortlek/FileEnvelope.java
@@ -1,10 +1,5 @@
-package org.maxgamer.quickshop.File;
+package org.maxgamer.quickshop.FilePortlek;
-import java.io.File;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
import lombok.ToString;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -21,21 +16,33 @@ import org.maxgamer.quickshop.Util.Location.LocationOf;
import org.maxgamer.quickshop.Util.Location.StringOf;
import org.maxgamer.quickshop.Util.Util;
+import java.io.File;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
@ToString
public abstract class FileEnvelope implements IFile {
- @NotNull protected final File file;
- protected final boolean loadDefault;
- @NotNull private final Plugin plugin;
- @NotNull private final Copied copied;
- @NotNull private final String resourcePath;
- @NotNull protected FileConfiguration fileConfiguration = new MckFileConfiguration();
+ @NotNull
+ protected final File file;
- public FileEnvelope(
- @NotNull Plugin plugin,
- @NotNull File file,
- @NotNull String resourcePath,
- boolean loadDefault) {
+ protected final boolean loadDefault;
+
+ @NotNull
+ private final Plugin plugin;
+
+ @NotNull
+ private final Copied copied;
+
+ @NotNull
+ private final String resourcePath;
+
+ @NotNull
+ protected FileConfiguration fileConfiguration = new MckFileConfiguration();
+
+ public FileEnvelope(@NotNull Plugin plugin, @NotNull File file, @NotNull String resourcePath, boolean loadDefault) {
this.plugin = plugin;
this.file = file;
this.copied = new Copied(file);
@@ -219,8 +226,7 @@ public abstract class FileEnvelope implements IFile {
@NotNull
@Override
public ConfigurationSection getSection(@NotNull String path) {
- final ConfigurationSection configurationSection =
- fileConfiguration.getConfigurationSection(path);
+ final ConfigurationSection configurationSection = fileConfiguration.getConfigurationSection(path);
return configurationSection == null ? new MckFileConfiguration() : configurationSection;
}
@@ -236,4 +242,5 @@ public abstract class FileEnvelope implements IFile {
return section;
}
+
}
diff --git a/src/main/java/org/maxgamer/quickshop/File/IFile.java b/src/main/java/org/maxgamer/quickshop/FilePortlek/IFile.java
similarity index 75%
rename from src/main/java/org/maxgamer/quickshop/File/IFile.java
rename to src/main/java/org/maxgamer/quickshop/FilePortlek/IFile.java
index 8bd4a75ea..dff0f3723 100644
--- a/src/main/java/org/maxgamer/quickshop/File/IFile.java
+++ b/src/main/java/org/maxgamer/quickshop/FilePortlek/IFile.java
@@ -1,8 +1,5 @@
-package org.maxgamer.quickshop.File;
+package org.maxgamer.quickshop.FilePortlek;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Optional;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
@@ -11,23 +8,33 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.maxgamer.quickshop.Mock.MckFileConfiguration;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Optional;
+
public interface IFile {
- /** Creates yml file on the path */
+ /**
+ * Creates yml file on the path
+ */
void create();
- @NotNull
- InputStream getInputStream();
+ @NotNull InputStream getInputStream();
- /** Reloads file */
+ /**
+ * Reloads file
+ */
void reload();
- /** Saves file */
+ /**
+ * Saves file
+ */
void save();
- /** @return the string of the file */
- @NotNull
- String saveToString();
+ /**
+ * @return the string of the file
+ */
+ @NotNull String saveToString();
/**
* Loads from the data
@@ -43,29 +50,26 @@ public interface IFile {
* @param path object path to get
* @return if path does not exist returns null
*/
- @Nullable
- Object get(@NotNull String path);
+ @Nullable Object get(@NotNull String path);
/**
* Gets the object with fallback
*
- * @param path object path to get
+ * @param path object path to get
* @param fallback fallback object to get if path does not exist
* @return if path does not exist returns fallback object
*/
- @Nullable
- Object get(@NotNull String path, @Nullable Object fallback);
+ @Nullable Object get(@NotNull String path, @Nullable Object fallback);
/**
* Gets or sets the object
*
- * @param path object path to get
+ * @param path object path to get
* @param fallback fallback object to get if path does not exist
- * @param object type
+ * @param object type
* @return if path does not exist returns and set the path with fallback object
*/
- @NotNull
- T getOrSet(@NotNull final String path, @NotNull T fallback);
+ @NotNull T getOrSet(@NotNull final String path, @NotNull T fallback);
/**
* Gets location
@@ -73,13 +77,12 @@ public interface IFile {
* @param path location path to get
* @return {@link Location}
*/
- @NotNull
- Location getLocation(@NotNull final String path);
+ @NotNull Location getLocation(@NotNull final String path);
/**
* Sets location into the path
*
- * @param path location path to set
+ * @param path location path to set
* @param location {@link Location}
*/
void setLocation(@NotNull final String path, @NotNull final Location location);
@@ -93,13 +96,12 @@ public interface IFile {
* @param path itemstack path to get
* @return {@link ItemStack}
*/
- @NotNull
- ItemStack getCustomItemStack(@NotNull final String path);
+ @NotNull ItemStack getCustomItemStack(@NotNull final String path);
/**
* Sets custom itemstack to path
*
- * @param path itemstack path to set
+ * @param path itemstack path to set
* @param itemStack {@link ItemStack}
*/
void setCustomItemStack(@NotNull final String path, @NotNull final ItemStack itemStack);
@@ -110,13 +112,12 @@ public interface IFile {
* @param path string path to get
* @return {@link String}
*/
- @NotNull
- Optional getString(@NotNull final String path);
+ @NotNull Optional getString(@NotNull final String path);
/**
* Sets object to path
*
- * @param path object path to set
+ * @param path object path to set
* @param object {@link Object}
*/
void set(@NotNull final String path, @Nullable final Object object);
@@ -127,8 +128,7 @@ public interface IFile {
* @param path string list path to get
* @return string list
*/
- @NotNull
- List getStringList(@NotNull final String path);
+ @NotNull List getStringList(@NotNull final String path);
/**
* Gets int
@@ -184,8 +184,7 @@ public interface IFile {
* @param path configuration section path to create
* @return {@link ConfigurationSection}
*/
- @NotNull
- ConfigurationSection createSection(@NotNull String path);
+ @NotNull ConfigurationSection createSection(@NotNull String path);
/**
* Gets configuration section from path
@@ -193,8 +192,7 @@ public interface IFile {
* @param path configurations section path to get
* @return if there isn't section returns {@link MckFileConfiguration}
*/
- @NotNull
- ConfigurationSection getSection(@NotNull final String path);
+ @NotNull ConfigurationSection getSection(@NotNull final String path);
/**
* Gets configuration section from path if there is no section It will create
@@ -202,6 +200,6 @@ public interface IFile {
* @param path configurations section path to get
* @return {@link ConfigurationSection}
*/
- @NotNull
- ConfigurationSection getOrCreateSection(@NotNull final String path);
+ @NotNull ConfigurationSection getOrCreateSection(@NotNull final String path);
+
}
diff --git a/src/main/java/org/maxgamer/quickshop/FilePortlek/JSONFile.java b/src/main/java/org/maxgamer/quickshop/FilePortlek/JSONFile.java
new file mode 100644
index 000000000..c0f0f24e1
--- /dev/null
+++ b/src/main/java/org/maxgamer/quickshop/FilePortlek/JSONFile.java
@@ -0,0 +1,37 @@
+package org.maxgamer.quickshop.FilePortlek;
+
+import org.bukkit.plugin.Plugin;
+import org.jetbrains.annotations.NotNull;
+import org.maxgamer.quickshop.NonQuickShopStuffs.com.dumbtruckman.JsonConfiguration.JSONConfiguration;
+
+import java.io.File;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+public final class JSONFile extends FileEnvelope {
+
+ public JSONFile(@NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath, boolean loadDefault) {
+ super(plugin, file, resourcePath.endsWith(".json") ? resourcePath : resourcePath + ".json", loadDefault);
+ }
+
+ public JSONFile(@NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath) {
+ super(plugin, file, resourcePath.endsWith(".json") ? resourcePath : resourcePath + ".json", true);
+ }
+
+ public JSONFile(@NotNull final Plugin plugin, @NotNull final String resourcePath, @NotNull final String fileName) {
+ this(plugin, new File(plugin.getDataFolder().getAbsolutePath() + (resourcePath.startsWith("/") ? resourcePath : "/" + resourcePath), fileName.endsWith(".json") ? fileName : fileName + ".json"), resourcePath.isEmpty() ? fileName : resourcePath.endsWith("/") ? resourcePath + fileName : resourcePath + "/" + fileName);
+ }
+
+ public JSONFile(@NotNull final Plugin plugin, @NotNull final String fileName) {
+ this(plugin, "", fileName);
+ }
+
+ @Override
+ public void reload() {
+ fileConfiguration = JSONConfiguration.loadConfiguration(file);
+ if (loadDefault) {
+ fileConfiguration.setDefaults(JSONConfiguration.loadConfiguration(new InputStreamReader(getInputStream(), StandardCharsets.UTF_8)));
+ }
+ }
+
+}
diff --git a/src/main/java/org/maxgamer/quickshop/FilePortlek/YAMLFile.java b/src/main/java/org/maxgamer/quickshop/FilePortlek/YAMLFile.java
new file mode 100644
index 000000000..1ef66b3bf
--- /dev/null
+++ b/src/main/java/org/maxgamer/quickshop/FilePortlek/YAMLFile.java
@@ -0,0 +1,36 @@
+package org.maxgamer.quickshop.FilePortlek;
+
+import org.bukkit.configuration.file.YamlConfiguration;
+import org.bukkit.plugin.Plugin;
+import org.jetbrains.annotations.NotNull;
+
+import java.io.File;
+import java.io.InputStreamReader;
+
+public final class YAMLFile extends FileEnvelope {
+
+ public YAMLFile(@NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath, boolean loadDefault) {
+ super(plugin, file, resourcePath.endsWith(".yml") ? resourcePath : resourcePath + ".yml", loadDefault);
+ }
+
+ public YAMLFile(@NotNull final Plugin plugin, @NotNull final File file, @NotNull final String resourcePath) {
+ super(plugin, file, resourcePath.endsWith(".yml") ? resourcePath : resourcePath + ".yml", true);
+ }
+
+ public YAMLFile(@NotNull final Plugin plugin, @NotNull final String resourcePath, @NotNull final String fileName) {
+ this(plugin, new File(plugin.getDataFolder().getAbsolutePath() + (resourcePath.startsWith("/") ? resourcePath : "/" + resourcePath), fileName.endsWith(".yml") ? fileName : fileName + ".yml"), resourcePath.isEmpty() ? fileName : resourcePath.endsWith("/") ? resourcePath + fileName : resourcePath + "/" + fileName);
+ }
+
+ public YAMLFile(@NotNull final Plugin plugin, @NotNull final String fileName) {
+ this(plugin, "", fileName);
+ }
+
+ @Override
+ public void reload() {
+ fileConfiguration = YamlConfiguration.loadConfiguration(file);
+ if (loadDefault) {
+ fileConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getInputStream())));
+ }
+ }
+
+}
diff --git a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java
index 79217f170..b01475e58 100644
--- a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java
+++ b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java
@@ -19,23 +19,6 @@
package org.maxgamer.quickshop.Util;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.file.Files;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.logging.Level;
import lombok.SneakyThrows;
import me.clip.placeholderapi.PlaceholderAPI;
import net.md_5.bungee.api.chat.ClickEvent;
@@ -59,11 +42,22 @@ import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.maxgamer.quickshop.File.IFile;
-import org.maxgamer.quickshop.File.JSONFile;
+import org.maxgamer.quickshop.FilePortlek.IFile;
+import org.maxgamer.quickshop.FilePortlek.JSONFile;
import org.maxgamer.quickshop.QuickShop;
import org.maxgamer.quickshop.Shop.Shop;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.file.Files;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.DecimalFormat;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.logging.Level;
+
@SuppressWarnings("WeakerAccess")
public class MsgUtil {
public static String invaildMsg = "Invaild message";
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 12cc5f9d6..51ba417c5 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -1,7 +1,7 @@
#This is example config, don't direct modify this file, all changes will revert when you reload the plugin.
#Do not touch if you not clear know about this
-config-version: 83
+config-version: 84
#Select the language you want to use, (e.g de), use only supported language codes from the list below.
#If you use a not exist/not support language, plugin will move to use en_US to keep everything working.
@@ -464,7 +464,8 @@ integration:
warzone: false
#Player must have flags in the faction:
flags: []
-
+protect:
+ explode: true
diff --git a/src/test/java/org/maxgamer/quickshop/File/FileEnvelopeTest.java b/src/test/java/org/maxgamer/quickshop/File/FileEnvelopeTest.java
deleted file mode 100644
index 83626ed3f..000000000
--- a/src/test/java/org/maxgamer/quickshop/File/FileEnvelopeTest.java
+++ /dev/null
@@ -1,769 +0,0 @@
-package org.maxgamer.quickshop.File;
-
-import be.seeseemelk.mockbukkit.MockBukkit;
-import org.bukkit.configuration.InvalidConfigurationException;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.maxgamer.quickshop.Mock.MckFileConfiguration;
-import org.maxgamer.quickshop.QuickShopTest;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class FileEnvelopeTest {
-
- private final List test = new ArrayList<>();
- private QuickShopTest plugin;
- private IFile json;
- private IFile yaml;
-
- @BeforeEach
- void start() {
- MockBukkit.mock();
- plugin = MockBukkit.load(QuickShopTest.class);
- json = new JSONFile(plugin, "messages");
- json.create();
- yaml = new YAMLFile(plugin, "messages");
- yaml.create();
- test.add("test");
- json.set("test.list", test);
- yaml.set("test.list", test);
- json.set("test.int", 13);
- yaml.set("test.int", 13);
- json.set("test.boolean", true);
- yaml.set("test.boolean", true);
- json.set("test.short", (short) 1);
- yaml.set("test.short", (short) 1);
- json.set("test.long", (long) 1);
- yaml.set("test.long", (long) 1);
- json.set("test.byte", (byte) 1);
- yaml.set("test.byte", (byte) 1);
- json.set("test.double", (double) 1);
- yaml.set("test.double", (double) 1);
- }
-
- @Test
- void saveToString() {
- System.out.println(
- json.saveToString()
- );
-
- System.out.println(
- yaml.saveToString()
- );
- }
-
- @Test
- void loadFromString() throws InvalidConfigurationException {
- json.loadFromString(JSON_STRING);
- yaml.loadFromString(YAML_STRING);
- }
-
- @Test
- void get() {
- assertEquals(
- "{0}",
- json.get("signs.item")
- );
- assertEquals(
- "{0}",
- yaml.get("signs.item")
- );
- }
-
- @Test
- void getString() {
- final Optional optionalS = json.getString("shop-staff-cleared");
- final Optional optionalSS = yaml.getString("shop-staff-cleared");
-
- if (!optionalS.isPresent() || !optionalSS.isPresent()) {
- throw new IllegalArgumentException("There no path called 'shop-staff-cleared'");
- }
-
- assertEquals(
- "&aSuccessfully removed all staff for your shop.",
- optionalS.get()
- );
- assertEquals(
- "&aSuccessfully removed all staff for your shop.",
- optionalSS.get()
- );
- }
-
- @Test
- void set() {
- json.set("test.test", "test");
- yaml.set("test.test", "test");
- assertEquals(
- "{0}",
- json.get("signs.item")
- );
- assertEquals(
- "{0}",
- yaml.get("signs.item")
- );
- }
-
- @Test
- void create() {
- json.create();
- yaml.create();
- }
-
- @Test
- void save() {
- json.save();
- yaml.save();
- }
-
- @Test
- void getWithFallback() {
- assertEquals(
- "&aSuccessfully removed all staff for your shop.",
- json.get("shop-staff-cleared", "test")
- );
- assertEquals(
- "&aSuccessfully removed all staff for your shop.",
- yaml.get("shop-staff-cleared", "test")
- );
- }
-
- @Test
- void getOrSet() {
- assertEquals(
- "test",
- json.getOrSet("test.test123", "test")
- );
- assertEquals(
- "test",
- yaml.getOrSet("test.test123", "test")
- );
- assertEquals(
- "test",
- json.getOrSet("test.test123", "test")
- );
- assertEquals(
- "test",
- yaml.getOrSet("test.test123", "test")
- );
- }
-
- @Test
- void getStringList() {
- assertEquals(
- test,
- json.getStringList("test.list")
- );
- assertEquals(
- test,
- yaml.getStringList("test.list")
- );
- }
-
- @Test
- void getInt() {
- assertEquals(
- 13,
- json.getInt("test.int")
- );
- assertEquals(
- 13,
- yaml.getInt("test.int")
- );
- }
-
- @Test
- void getDouble() {
- assertEquals(
- 1,
- json.getDouble("test.short")
- );
- assertEquals(
- 1,
- yaml.getDouble("test.short")
- );
- }
-
- @Test
- void getLong() {
- assertEquals(
- 1,
- json.getLong("test.short")
- );
- assertEquals(
- 1,
- yaml.getLong("test.short")
- );
- }
-
- @Test
- void getByte() {
- assertEquals(
- (byte) 1,
- json.getByte("test.short")
- );
- assertEquals(
- (byte) 1,
- yaml.getByte("test.short")
- );
- }
-
- @Test
- void getShort() {
- assertEquals(
- (short) 1,
- json.getShort("test.short")
- );
- assertEquals(
- (short) 1,
- yaml.getShort("test.short")
- );
- }
-
- @Test
- void getBoolean() {
- assertTrue(
- json.getBoolean("test.boolean")
- );
- assertTrue(
- yaml.getBoolean("test.boolean")
- );
- }
-
- @Test
- void createSection() {
- json.createSection("test.section");
- yaml.createSection("test.section");
- }
-
- @Test
- void getSection() {
- assertTrue(
- () -> !(json.getSection("test.section") instanceof MckFileConfiguration)
- );
- assertTrue(
- () -> !(yaml.getSection("test.section") instanceof MckFileConfiguration)
- );
- }
-
- @Test
- void getOrCreateSection() {
- assertTrue(
- () -> !(json.getOrCreateSection("test.section") instanceof MckFileConfiguration)
- );
- assertTrue(
- () -> !(yaml.getOrCreateSection("test.section") instanceof MckFileConfiguration)
- );
- }
-
- @AfterEach
- void stop() {
- json.save();
- yaml.save();
- MockBukkit.unload();
- }
-
- private static final String JSON_STRING = "{\n" +
- " \"shop-staff-cleared\": \"&aSuccessfully removed all staff for your shop.\",\n" +
- " \"failed-to-paste\": \"&cFailed to upload the data to Pastebin, Check your internet and try again. (See console for details)\",\n" +
- " \"chest-was-removed\": \"&cThe chest was removed.\",\n" +
- " \"thats-not-a-number\": \"&cInvalid number\",\n" +
- " \"shop-already-owned\": \"&cThat is already a shop.\",\n" +
- " \"buying-more-than-selling\": \"&cWARNING: You are buying items for more than you are selling them!\",\n" +
- " \"signs\": {\n" +
- " \"item\": \"{0}\",\n" +
- " \"selling\": \"Selling {0}\",\n" +
- " \"header\": \"&c{0}\",\n" +
- " \"price\": \"{0} each\",\n" +
- " \"unlimited\": \"Unlimited\",\n" +
- " \"buying\": \"Buying {0}\"\n" +
- " },\n" +
- " \"price-too-high\": \"&c The shop price too high! You can't create one that is priced higher than {0}.\",\n" +
- " \"no-pending-action\": \"&cYou do not have any pending action\",\n" +
- " \"restricted-prices\": \"&cRestricted prices for {0}: min {1} , max {2}\",\n" +
- " \"not-a-number\": \"&cThere can only be number, but you input {0}\",\n" +
- " \"shop-purchase-cancelled\": \"&cCancelled Shop Purchase.\",\n" +
- " \"updatenotify\": {\n" +
- " \"onekeybuttontitle\": \"[OneKey Update]\",\n" +
- " \"remote-disable-warning\": \"&cThis version of QuickShop is marked disabled by remote server, that mean this version may have serious problem, get details from our SpigotMC page: {0}. This warning will appear and spam your console until you use other not disabled version to replace this one, doesn't effect your server running.\",\n" +
- " \"list\": [\n" +
- " \"{0} is released, You are still using {1}!\",\n" +
- " \"Boom! New update {0} incoming, Update!\",\n" +
- " \"Surprise! {0} came out, you are on {1}\",\n" +
- " \"Looks like you need to update, {0} is released!\",\n" +
- " \"Ooops! {0} is now released, you are on {1}!\",\n" +
- " \"I promise, QS has been updated to {0}, why have you not updated?\",\n" +
- " \"Fixing and re... Sorry {0} is released!\",\n" +
- " \"Err! Nope, this is not an error, {0} has just been released!\",\n" +
- " \"OMG! {0} came out! Why are you still using {1}?\",\n" +
- " \"Todays News: QuickShop has been updated to {0}!\",\n" +
- " \"Plugin K.I.A, You should update to {0}!\",\n" +
- " \"Fuze is fuzeing update {0}, save update!\",\n" +
- " \"There is an update commander, {0} has just come out!\",\n" +
- " \"Look me style---{0} updated, your still using {1}\",\n" +
- " \"Ahhhhhhh! New update {0}! Update!\",\n" +
- " \"What U thinking? {0} has been released! Update!\"\n" +
- " ],\n" +
- " \"buttontitle\": \"[Update Now]\",\n" +
- " \"label\": {\n" +
- " \"lts\": \"[LTS]\",\n" +
- " \"bukkitdev\": \"[BukkitDev]\",\n" +
- " \"github\": \"[Github]\",\n" +
- " \"unstable\": \"[Unstable]\",\n" +
- " \"stable\": \"[Stable]\",\n" +
- " \"qualityverifyed\": \"[Quality]\",\n" +
- " \"spigotmc\": \"[SpigotMC]\"\n" +
- " }\n" +
- " },\n" +
- " \"no-anythings-in-your-hand\": \"&cThere is nothing in your hand.\",\n" +
- " \"warn-to-paste\": \"&eCollecting data and uploading it to Pastebin, this may take a while. &c&lWarning&c, The data is kept public for one week, it may leak your server configuration and other sensitive information, make sure you only send it to your <rusted staff/developer.\",\n" +
- " \"the-owner-cant-afford-to-buy-from-you\": \"&cThat costs {0} but the owner only has {1}\",\n" +
- " \"menu\": {\n" +
- " \"sell-tax-self\": \"&aYou own this shop so you don't pay taxes.\",\n" +
- " \"this-shop-is-selling\": \"&aThis shop is &bSELLING&a items.\",\n" +
- " \"successful-purchase\": \"&aSuccessfully Purchased:\",\n" +
- " \"enchants\": \"&5Enchants\",\n" +
- " \"item-name-and-price\": \"&e{0} {1} &afor &e{2}\",\n" +
- " \"this-shop-is-buying\": \"&aThis shop is &dBUYING&a items.\",\n" +
- " \"effects\": \"&aEffects: &e{0}\",\n" +
- " \"owner\": \"&aOwner: {0}\",\n" +
- " \"total-value-of-chest\": \"&aTotal value of Chest: &e{0}\",\n" +
- " \"commands\": {\n" +
- " \"preview\": \"/qs silentpreview {0} {1} {2} {3}\"\n" +
- " },\n" +
- " \"price-per\": \"&aPrice per &e{0} &a- &e{1}\",\n" +
- " \"space\": \"&aSpace: &e{0}\",\n" +
- " \"sell-tax\": \"&aYou paid &e{0} &ain taxes.\",\n" +
- " \"stored-enchants\": \"&5Stored Enchants\",\n" +
- " \"item\": \"&aItem: &e{0}\",\n" +
- " \"successfully-sold\": \"&aSuccessfully Sold:\",\n" +
- " \"preview\": \"&b[Preview Item]\",\n" +
- " \"damage-percent-remaining\": \"&e{0}% &aRemaining.\",\n" +
- " \"shop-information\": \"&aShop Information:\",\n" +
- " \"stock\": \"&aStock &e{0}\"\n" +
- " },\n" +
- " \"player-bought-from-your-store\": \"&c{0} purchased {1} {2} from your store.\",\n" +
- " \"no-price-given\": \"&cPlease give a valid price.\",\n" +
- " \"booleanformat\": {\n" +
- " \"failed\": \"&c✘\",\n" +
- " \"success\": \"&a✔\"\n" +
- " },\n" +
- " \"blacklisted-item\": \"&cThat item is blacklisted. You may not sell it\",\n" +
- " \"success-created-shop\": \"&aCreated shop.\",\n" +
- " \"shop-has-no-space\": \"&cThe shop only has room for {0} more {1}.\",\n" +
- " \"no-creative-break\": \"&cYou cannot break other players shops in creative mode. Use survival instead.\",\n" +
- " \"translation-version\": \"&c&lSupport Version: &b&lReremake\",\n" +
- " \"how-much-to-trade-for\": \"&aEnter how much you wish to trade one &e{0}&a for in chat.\",\n" +
- " \"shop-has-changed\": \"&cThe shop you tried to use has changed since you clicked it!\",\n" +
- " \"not-a-integer\": \"&cThere can only be integer, but you input {0}\",\n" +
- " \"success-change-owner-to-server\": \"&aSuccessfully set the shop owner to Server.\",\n" +
- " \"not-looking-at-shop\": \"&cNo QuickShop was found, you must be looking at one.\",\n" +
- " \"you-dont-have-that-many-items\": \"&cYou only have {0} {1}.\",\n" +
- " \"language-version\": 24,\n" +
- " \"shop-not-exist\": \"&cThere had no shop.\",\n" +
- " \"translation-country\": \"&c&lLanguage Zone: &b&lEnglish (en_US)\",\n" +
- " \"unknown-player\": \"&cTarget player doesn't exist, please check the username you typed.\",\n" +
- " \"you-cant-afford-to-change-price\": \"&cIt costs {0} to change the price in your shop.\",\n" +
- " \"negative-amount\": \"&cDerp, can't trade negative amounts\",\n" +
- " \"success-removed-shop\": \"&aShop removed.\",\n" +
- " \"how-many-sell\": \"&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available. Enter &ball&a to sell them all.\",\n" +
- " \"you-cant-afford-a-new-shop\": \"&cIt costs {0} to create a new shop.\",\n" +
- " \"shop-creation-cancelled\": \"&cCancelled Shop Creation.\",\n" +
- " \"owner-bypass-check\": \"&eBypassed all checks, Trade successful! (You are shop owner)\",\n" +
- " \"tableformat\": {\n" +
- " \"left_half_line\": \"+--------------------\",\n" +
- " \"right_half_line\": \"--------------------+\",\n" +
- " \"full_line\": \"+---------------------------------------------------+\",\n" +
- " \"left_begin\": \"| \"\n" +
- " },\n" +
- " \"shop-staff-deleted\": \"&aSuccessfully removed {0} from your shop staffs.\",\n" +
- " \"that-is-locked\": \"&cThat shop is locked.\",\n" +
- " \"no-nearby-shop\": \"&cNo shops matching {0} nearby.\",\n" +
- " \"you-cant-create-shop-in-there\": \"&cYou don't have permission to create a shop at this location.\",\n" +
- " \"shop-stock-too-low\": \"&cThe shop only has {0} {1} left\",\n" +
- " \"fee-charged-for-price-change\": \"&aYou pay &c{0}&a to change the price.\",\n" +
- " \"how-many-buy\": \"&aEnter how many you wish to &bBUY&a in chat. You can buy &e{0}&a. Enter &ball&a to buy them all.\",\n" +
- " \"failed-to-put-sign\": \"&cNot enough space around the shop to place the information sign.\",\n" +
- " \"controlpanel\": {\n" +
- " \"mode-buying-hover\": \"&eClick to convert the shop to be in the selling mode.\",\n" +
- " \"refill-hover\": \"&eClick to refill the shop.\",\n" +
- " \"empty-hover\": \"&eClick to clear the inventory of the shop.\",\n" +
- " \"price\": \"&aPrice: &b{0} &e[&d&lSet&e]\",\n" +
- " \"unlimited\": \"&aUnlimited: {0} &e[&d&lSwitch&e]\",\n" +
- " \"price-hover\": \"&eClick to set a new price for the shop.\",\n" +
- " \"setowner-hover\": \"&eClick to switch owner.\",\n" +
- " \"setowner\": \"&aOwner: &b{0} &e[&d&lChange&e]\",\n" +
- " \"unlimited-hover\": \"&eClick to toggle if the shop is unlimited.\",\n" +
- " \"mode-buying\": \"&aShop mode: &bBuying &e[&d&lSwitch&e]\",\n" +
- " \"refill\": \"&aRefill: Refill the shop items &e[&d&lOK&e]\",\n" +
- " \"mode-selling-hover\": \"&eClick to convert the shop to be in the buying mode.\",\n" +
- " \"commands\": {\n" +
- " \"sell\": \"/qs silentsell {0} {1} {2} {3}\",\n" +
- " \"buy\": \"/qs silentbuy {0} {1} {2} {3}\",\n" +
- " \"price\": \"/qs price [New Price]\",\n" +
- " \"unlimited\": \"/qs silentunlimited {0} {1} {2} {3}\",\n" +
- " \"remove\": \"/qs silentremove {0} {1} {2} {3}\",\n" +
- " \"setowner\": \"/qs setowner [Player]\",\n" +
- " \"refill\": \"/qs refill [Amount]\",\n" +
- " \"empty\": \"/qs silentempty {0} {1} {2} {3}\"\n" +
- " },\n" +
- " \"remove\": \"&c&l[Remove Shop]\",\n" +
- " \"infomation\": \"&aShop Control Panel:\",\n" +
- " \"mode-selling\": \"&aShop mode: &bSelling &e[&d&lSwitch&e]\",\n" +
- " \"remove-hover\": \"&eClick to remove this shop.\",\n" +
- " \"empty\": \"&aEmpty: Remove shop all items &e[&d&lOK&e]\"\n" +
- " },\n" +
- " \"permission-denied-3rd-party\": \"&cPermission denied: 3rd party plugin [{0}].\",\n" +
- " \"not-enough-space\": \"&cYou only have room for {0} more of that!\",\n" +
- " \"average-price-nearby\": \"&aAverage Price Nearby: &e{0}\",\n" +
- " \"not-allowed-to-create\": \"&cYou may not create a shop here.\",\n" +
- " \"price-too-cheap\": \"&cPrice must be greater than &e${0}\",\n" +
- " \"shop-removed-cause-ongoing-fee\": \"&cYou shop at {0} was removed cause you had no enough money to keep it!\",\n" +
- " \"player-sold-to-your-store\": \"&a{0} sold {1} {2} to your store.\",\n" +
- " \"no-enough-money-to-keep-shops\": \"&cYou didn't have enough money to keep your shops! All shops have now been removed...\",\n" +
- " \"shop-staff-added\": \"&aSuccessfully added {0} to your shop staffs.\",\n" +
- " \"nothing-to-flush\": \"&aYou had no new shop message.\",\n" +
- " \"empty-success\": \"&aEmpty success\",\n" +
- " \"flush-finished\": \"&aSuccessfully flushed the messages.\",\n" +
- " \"unknown-owner\": \"Unknown\",\n" +
- " \"bypassing-lock\": \"&cBypassing a QuickShop lock!\",\n" +
- " \"nearby-shop-this-way\": \"&aShop is {0} blocks away from you.\",\n" +
- " \"no-double-chests\": \"&cYou cannot create the DoubleChest shop.\",\n" +
- " \"shop-out-of-stock\": \"&5Your shop at {0}, {1}, {2}, has run out of {3}\",\n" +
- " \"purchase-failed\": \"&cPurchase failed: Internal Error, please contact the server administrator.\",\n" +
- " \"price-is-now\": \"&aThe shops new price is &e{0}\",\n" +
- " \"reached-maximum-can-create\": \"&cYou have already created a maximum of {0}/{1} shops!\",\n" +
- " \"no-permission\": \"&cYou do not have permission to do that.\",\n" +
- " \"shop-out-of-space\": \"&5Your shop at {0}, {1}, {2}, is now full.\",\n" +
- " \"player-bought-from-your-store-tax\": \"&c{0} purchased {1} {2} from your store, and you paid {3} in taxes.\",\n" +
- " \"no-permission-build\": \"&cYou can't build a shop here.\",\n" +
- " \"refill-success\": \"&aRefill success\",\n" +
- " \"translation-author\": \"&c&lTranslator: &b&lGhost_chu\",\n" +
- " \"break-shop-use-supertool\": \"&eYou can break the shop by using the SuperTool.\",\n" +
- " \"translation-contributors\": \"&c&lContributors: &b&lTimtower, Netherfoam, KaiNoMood and Mgazul\",\n" +
- " \"command\": {\n" +
- " \"toggle-unlimited\": {\n" +
- " \"limited\": \"&aShop is now limited\",\n" +
- " \"unlimited\": \"&aShop is now unlimited\"\n" +
- " },\n" +
- " \"no-type-given\": \"&cUsage: /qs find - \",\n" +
- " \"description\": {\n" +
- " \"info\": \"&eShow QuickShop Statistics\",\n" +
- " \"buy\": \"&eConverts a shop to &dBUY&e mode\",\n" +
- " \"help\": \"&eShow QuickShop helps\",\n" +
- " \"price\": \"&eChanges the buy/selling price of one of your shops\",\n" +
- " \"unlimited\": \"&eMakes a shop unlimited\",\n" +
- " \"about\": \"&eShow QuickShop abouts\",\n" +
- " \"setowner\": \"&eChanges who owns a shop\",\n" +
- " \"owner\": \"&eChanges who owns a shop\",\n" +
- " \"refill\": \"&eAdds a given number of items to a shop\",\n" +
- " \"paste\": \"&eAuto upload server data to Pastebin\",\n" +
- " \"find\": \"&eLocates the nearest shop of a specific type.\",\n" +
- " \"staff\": \"&eManage your shop staffs\",\n" +
- " \"sell\": \"&eConverts a shop to &bSELL&e mode\",\n" +
- " \"supercreate\": \"&eCreate a shop bypass all protection checks\",\n" +
- " \"title\": \"&aQuickShop Help\",\n" +
- " \"create\": \"&eCreates a new shop at the target chest\",\n" +
- " \"remove\": \"&eRemove your looking the shop\",\n" +
- " \"reload\": \"&eReloads the config.yml for QuickShop\",\n" +
- " \"amount\": \"&eExecute for your actions with amount(For chat plugin issue)\",\n" +
- " \"clean\": \"&eRemoves all (loaded) shops with 0 stock\",\n" +
- " \"debug\": \"&eSwitch to developer mode\",\n" +
- " \"fetchmessage\": \"&eFetch unread shop message\",\n" +
- " \"empty\": \"&eRemoves all stock from a shop\"\n" +
- " },\n" +
- " \"new-owner\": \"&aNew owner: &e{0}\",\n" +
- " \"now-buying\": \"&aNow &dBUYING&a &e{0}\",\n" +
- " \"now-selling\": \"&aNow &bSELLING &e{0}\",\n" +
- " \"no-owner-given\": \"&cNo owner given. Use &a/qs setowner &c\",\n" +
- " \"no-amount-given\": \"&cNo amount given. Use &a/qs refill &c\",\n" +
- " \"reloading\": \"&aReloading...\",\n" +
- " \"cleaning\": \"&aCleaning up shops with 0 stock...\",\n" +
- " \"now-nolonger-debuging\": \"&aSuccessfully switched to production mode, Reloading QuickShop...\",\n" +
- " \"cleaned\": \"&aCleaned &e{0}&a shops\",\n" +
- " \"now-debuging\": \"&aSuccessfully switched to developer mode, Reloading QuickShop...\",\n" +
- " \"wrong-args\": \"&cParameters don't match, use /qs help to check help\"\n" +
- " },\n" +
- " \"no-price-change\": \"&cThat wouldn't result in a price change!\",\n" +
- " \"shops-arent-locked\": \"&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!\",\n" +
- " \"admin-shop\": \"AdminShop\",\n" +
- " \"you-cant-afford-to-buy\": \"&cThat costs {0}, but you only have {1}\",\n" +
- " \"tabcomplete\": {\n" +
- " \"range\": \"[range]\",\n" +
- " \"amount\": \"[amount]\",\n" +
- " \"price\": \"[price]\"\n" +
- " },\n" +
- " \"test\": {\n" +
- " \"list\": [\n" +
- " \"test\"\n" +
- " ],\n" +
- " \"int\": 13,\n" +
- " \"boolean\": true,\n" +
- " \"short\": 1,\n" +
- " \"long\": 1,\n" +
- " \"byte\": 1,\n" +
- " \"double\": 1.0,\n" +
- " \"section\": {},\n" +
- " \"test\": \"test\",\n" +
- " \"test123\": \"test\"\n" +
- " }\n" +
- "}";
-
- private static final String YAML_STRING = "# Colors:\n" +
- "# &0-9, &a-f\n" +
- "# {0}, {1}, {2}, etc are variables. You can swap them around, but adding a new variable won't work. Removing them will work\n" +
- "# \n" +
- "# Translate data.\n" +
- "# ======================================================================\n" +
- "# For Translator: These string can changed by your self.\n" +
- "translation-author: '&c&lTranslator: &b&lGhost_chu'\n" +
- "translation-contributors: '&c&lContributors: &b&lTimtower, Netherfoam, KaiNoMood and\n" +
- " Mgazul'\n" +
- "translation-version: '&c&lSupport Version: &b&lReremake'\n" +
- "translation-country: '&c&lLanguage Zone: &b&lEnglish (en_US)'\n" +
- "language-version: 24\n" +
- "not-looking-at-shop: '&cNo QuickShop was found, you must be looking at one.'\n" +
- "no-anythings-in-your-hand: '&cThere is nothing in your hand.'\n" +
- "no-permission: '&cYou do not have permission to do that.'\n" +
- "no-creative-break: '&cYou cannot break other players shops in creative mode. Use\n" +
- " survival instead.'\n" +
- "no-double-chests: '&cYou cannot create the DoubleChest shop.'\n" +
- "shop-already-owned: '&cThat is already a shop.'\n" +
- "chest-was-removed: '&cThe chest was removed.'\n" +
- "price-too-cheap: '&cPrice must be greater than &e${0}'\n" +
- "no-price-change: '&cThat wouldn''t result in a price change!'\n" +
- "you-cant-afford-a-new-shop: '&cIt costs {0} to create a new shop.'\n" +
- "player-bought-from-your-store-tax: '&c{0} purchased {1} {2} from your store, and you\n" +
- " paid {3} in taxes.'\n" +
- "you-cant-afford-to-change-price: '&cIt costs {0} to change the price in your shop.'\n" +
- "success-created-shop: '&aCreated shop.'\n" +
- "success-removed-shop: '&aShop removed.'\n" +
- "shops-arent-locked: '&cRemember, shops are NOT protected from theft! If you want to\n" +
- " stop thieves, lock it with LWC, Lockette, etc!'\n" +
- "shop-creation-cancelled: '&cCancelled Shop Creation.'\n" +
- "shop-purchase-cancelled: '&cCancelled Shop Purchase.'\n" +
- "shop-stock-too-low: '&cThe shop only has {0} {1} left'\n" +
- "you-cant-afford-to-buy: '&cThat costs {0}, but you only have {1}'\n" +
- "negative-amount: '&cDerp, can''t trade negative amounts'\n" +
- "not-a-number: '&cThere can only be number, but you input {0}'\n" +
- "not-a-integer: '&cThere can only be integer, but you input {0}'\n" +
- "player-bought-from-your-store: '&c{0} purchased {1} {2} from your store.'\n" +
- "shop-out-of-stock: '&5Your shop at {0}, {1}, {2}, has run out of {3}'\n" +
- "shop-has-no-space: '&cThe shop only has room for {0} more {1}.'\n" +
- "you-dont-have-that-many-items: '&cYou only have {0} {1}.'\n" +
- "the-owner-cant-afford-to-buy-from-you: '&cThat costs {0} but the owner only has {1}'\n" +
- "player-sold-to-your-store: '&a{0} sold {1} {2} to your store.'\n" +
- "shop-out-of-space: '&5Your shop at {0}, {1}, {2}, is now full.'\n" +
- "fee-charged-for-price-change: '&aYou pay &c{0}&a to change the price.'\n" +
- "price-is-now: '&aThe shops new price is &e{0}'\n" +
- "thats-not-a-number: '&cInvalid number'\n" +
- "no-price-given: '&cPlease give a valid price.'\n" +
- "average-price-nearby: '&aAverage Price Nearby: &e{0}'\n" +
- "shop-has-changed: '&cThe shop you tried to use has changed since you clicked it!'\n" +
- "shop-not-exist: '&cThere had no shop.'\n" +
- "nearby-shop-this-way: '&aShop is {0} blocks away from you.'\n" +
- "no-nearby-shop: '&cNo shops matching {0} nearby.'\n" +
- "buying-more-than-selling: '&cWARNING: You are buying items for more than you are selling\n" +
- " them!'\n" +
- "not-enough-space: '&cYou only have room for {0} more of that!'\n" +
- "refill-success: '&aRefill success'\n" +
- "empty-success: '&aEmpty success'\n" +
- "admin-shop: AdminShop\n" +
- "unknown-owner: Unknown\n" +
- "owner-bypass-check: '&eBypassed all checks, Trade successful! (You are shop owner)'\n" +
- "reached-maximum-can-create: '&cYou have already created a maximum of {0}/{1} shops!'\n" +
- "restricted-prices: '&cRestricted prices for {0}: min {1} , max {2}'\n" +
- "no-enough-money-to-keep-shops: '&cYou didn''t have enough money to keep your shops!\n" +
- " All shops have now been removed...'\n" +
- "nothing-to-flush: '&aYou had no new shop message.'\n" +
- "break-shop-use-supertool: '&eYou can break the shop by using the SuperTool.'\n" +
- "failed-to-put-sign: '&cNot enough space around the shop to place the information sign.'\n" +
- "failed-to-paste: '&cFailed to upload the data to Pastebin, Check your internet and\n" +
- " try again. (See console for details)'\n" +
- "warn-to-paste: '&eCollecting data and uploading it to Pastebin, this may take a while.\n" +
- " &c&lWarning&c, The data is kept public for one week, it may leak your server configuration\n" +
- " and other sensitive information, make sure you only send it to your <rusted staff/developer.'\n" +
- "price-too-high: '&c The shop price too high! You can''t create one that is priced\n" +
- " higher than {0}.'\n" +
- "you-cant-create-shop-in-there: '&cYou don''t have permission to create a shop at this\n" +
- " location.'\n" +
- "unknown-player: '&cTarget player doesn''t exist, please check the username you typed.'\n" +
- "shop-staff-cleared: '&aSuccessfully removed all staff for your shop.'\n" +
- "shop-staff-added: '&aSuccessfully added {0} to your shop staffs.'\n" +
- "shop-staff-deleted: '&aSuccessfully removed {0} from your shop staffs.'\n" +
- "no-permission-build: '&cYou can''t build a shop here.'\n" +
- "success-change-owner-to-server: '&aSuccessfully set the shop owner to Server.'\n" +
- "flush-finished: '&aSuccessfully flushed the messages.'\n" +
- "purchase-failed: '&cPurchase failed: Internal Error, please contact the server administrator.'\n" +
- "no-pending-action: '&cYou do not have any pending action'\n" +
- "permission-denied-3rd-party: '&cPermission denied: 3rd party plugin [{0}].'\n" +
- "menu:\n" +
- " successful-purchase: '&aSuccessfully Purchased:'\n" +
- " successfully-sold: '&aSuccessfully Sold:'\n" +
- " item-name-and-price: '&e{0} {1} &afor &e{2}'\n" +
- " sell-tax: '&aYou paid &e{0} &ain taxes.'\n" +
- " sell-tax-self: '&aYou own this shop so you don''t pay taxes.'\n" +
- " enchants: '&5Enchants'\n" +
- " stored-enchants: '&5Stored Enchants'\n" +
- " shop-information: '&aShop Information:'\n" +
- " owner: '&aOwner: {0}'\n" +
- " item: '&aItem: &e{0}'\n" +
- " preview: '&b[Preview Item]'\n" +
- " space: '&aSpace: &e{0}'\n" +
- " stock: '&aStock &e{0}'\n" +
- " price-per: '&aPrice per &e{0} &a- &e{1}'\n" +
- " total-value-of-chest: '&aTotal value of Chest: &e{0}'\n" +
- " damage-percent-remaining: '&e{0}% &aRemaining.'\n" +
- " this-shop-is-buying: '&aThis shop is &dBUYING&a items.'\n" +
- " this-shop-is-selling: '&aThis shop is &bSELLING&a items.'\n" +
- " effects: '&aEffects: &e{0}'\n" +
- " commands:\n" +
- " preview: /qs silentpreview {0} {1} {2} {3}\n" +
- "bypassing-lock: '&cBypassing a QuickShop lock!'\n" +
- "that-is-locked: '&cThat shop is locked.'\n" +
- "how-many-buy: '&aEnter how many you wish to &bBUY&a in chat. You can buy &e{0}&a.\n" +
- " Enter &ball&a to buy them all.'\n" +
- "how-many-sell: '&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available.\n" +
- " Enter &ball&a to sell them all.'\n" +
- "not-allowed-to-create: '&cYou may not create a shop here.'\n" +
- "blacklisted-item: '&cThat item is blacklisted. You may not sell it'\n" +
- "how-much-to-trade-for: '&aEnter how much you wish to trade one &e{0}&a for in chat.'\n" +
- "command:\n" +
- " toggle-unlimited:\n" +
- " unlimited: '&aShop is now unlimited'\n" +
- " limited: '&aShop is now limited'\n" +
- " no-owner-given: '&cNo owner given. Use &a/qs setowner &c'\n" +
- " new-owner: '&aNew owner: &e{0}'\n" +
- " now-buying: '&aNow &dBUYING&a &e{0}'\n" +
- " now-selling: '&aNow &bSELLING &e{0}'\n" +
- " cleaning: '&aCleaning up shops with 0 stock...'\n" +
- " reloading: '&aReloading...'\n" +
- " cleaned: '&aCleaned &e{0}&a shops'\n" +
- " no-type-given: '&cUsage: /qs find
- '\n" +
- " no-amount-given: '&cNo amount given. Use &a/qs refill &c'\n" +
- " now-debuging: '&aSuccessfully switched to developer mode, Reloading QuickShop...'\n" +
- " now-nolonger-debuging: '&aSuccessfully switched to production mode, Reloading QuickShop...'\n" +
- " wrong-args: '&cParameters don''t match, use /qs help to check help'\n" +
- " description:\n" +
- " title: '&aQuickShop Help'\n" +
- " unlimited: '&eMakes a shop unlimited'\n" +
- " setowner: '&eChanges who owns a shop'\n" +
- " owner: '&eChanges who owns a shop'\n" +
- " buy: '&eConverts a shop to &dBUY&e mode'\n" +
- " sell: '&eConverts a shop to &bSELL&e mode'\n" +
- " clean: '&eRemoves all (loaded) shops with 0 stock'\n" +
- " price: '&eChanges the buy/selling price of one of your shops'\n" +
- " find: '&eLocates the nearest shop of a specific type.'\n" +
- " reload: '&eReloads the config.yml for QuickShop'\n" +
- " refill: '&eAdds a given number of items to a shop'\n" +
- " empty: '&eRemoves all stock from a shop'\n" +
- " create: '&eCreates a new shop at the target chest'\n" +
- " debug: '&eSwitch to developer mode'\n" +
- " fetchmessage: '&eFetch unread shop message'\n" +
- " info: '&eShow QuickShop Statistics'\n" +
- " paste: '&eAuto upload server data to Pastebin'\n" +
- " staff: '&eManage your shop staffs'\n" +
- " remove: '&eRemove your looking the shop'\n" +
- " amount: '&eExecute for your actions with amount(For chat plugin issue)'\n" +
- " about: '&eShow QuickShop abouts'\n" +
- " help: '&eShow QuickShop helps'\n" +
- " supercreate: '&eCreate a shop bypass all protection checks'\n" +
- "signs:\n" +
- " header: '&c{0}'\n" +
- " selling: Selling {0}\n" +
- " buying: Buying {0}\n" +
- " item: '{0}'\n" +
- " price: '{0} each'\n" +
- " unlimited: Unlimited\n" +
- "controlpanel:\n" +
- " infomation: '&aShop Control Panel:'\n" +
- " setowner: '&aOwner: &b{0} &e[&d&lChange&e]'\n" +
- " setowner-hover: '&eClick to switch owner.'\n" +
- " unlimited: '&aUnlimited: {0} &e[&d&lSwitch&e]'\n" +
- " unlimited-hover: '&eClick to toggle if the shop is unlimited.'\n" +
- " mode-selling: '&aShop mode: &bSelling &e[&d&lSwitch&e]'\n" +
- " mode-selling-hover: '&eClick to convert the shop to be in the buying mode.'\n" +
- " mode-buying: '&aShop mode: &bBuying &e[&d&lSwitch&e]'\n" +
- " mode-buying-hover: '&eClick to convert the shop to be in the selling mode.'\n" +
- " price: '&aPrice: &b{0} &e[&d&lSet&e]'\n" +
- " price-hover: '&eClick to set a new price for the shop.'\n" +
- " refill: '&aRefill: Refill the shop items &e[&d&lOK&e]'\n" +
- " refill-hover: '&eClick to refill the shop.'\n" +
- " empty: '&aEmpty: Remove shop all items &e[&d&lOK&e]'\n" +
- " empty-hover: '&eClick to clear the inventory of the shop.'\n" +
- " remove: '&c&l[Remove Shop]'\n" +
- " remove-hover: '&eClick to remove this shop.'\n" +
- " commands:\n" +
- " setowner: /qs setowner [Player]\n" +
- " unlimited: /qs silentunlimited {0} {1} {2} {3}\n" +
- " buy: /qs silentbuy {0} {1} {2} {3}\n" +
- " sell: /qs silentsell {0} {1} {2} {3}\n" +
- " price: /qs price [New Price]\n" +
- " refill: /qs refill [Amount]\n" +
- " empty: /qs silentempty {0} {1} {2} {3}\n" +
- " remove: /qs silentremove {0} {1} {2} {3}\n" +
- "tableformat:\n" +
- " full_line: +---------------------------------------------------+\n" +
- " left_half_line: +--------------------\n" +
- " right_half_line: '--------------------+'\n" +
- " left_begin: '| '\n" +
- "booleanformat:\n" +
- " success: '&a✔'\n" +
- " failed: '&c✘'\n" +
- "tabcomplete:\n" +
- " price: '[price]'\n" +
- " range: '[range]'\n" +
- " amount: '[amount]'\n" +
- "updatenotify:\n" +
- " buttontitle: '[Update Now]'\n" +
- " onekeybuttontitle: '[OneKey Update]'\n" +
- " list:\n" +
- " - '{0} is released, You are still using {1}!'\n" +
- " - Boom! New update {0} incoming, Update!\n" +
- " - Surprise! {0} came out, you are on {1}\n" +
- " - Looks like you need to update, {0} is released!\n" +
- " - Ooops! {0} is now released, you are on {1}!\n" +
- " - I promise, QS has been updated to {0}, why have you not updated?\n" +
- " - Fixing and re... Sorry {0} is released!\n" +
- " - Err! Nope, this is not an error, {0} has just been released!\n" +
- " - OMG! {0} came out! Why are you still using {1}?\n" +
- " - 'Todays News: QuickShop has been updated to {0}!'\n" +
- " - Plugin K.I.A, You should update to {0}!\n" +
- " - Fuze is fuzeing update {0}, save update!\n" +
- " - There is an update commander, {0} has just come out!\n" +
- " - Look me style---{0} updated, your still using {1}\n" +
- " - Ahhhhhhh! New update {0}! Update!\n" +
- " - What U thinking? {0} has been released! Update!\n" +
- " remote-disable-warning: '&cThis version of QuickShop is marked disabled by remote\n" +
- " server, that mean this version may have serious problem, get details from our\n" +
- " SpigotMC page: {0}. This warning will appear and spam your console until you use\n" +
- " other not disabled version to replace this one, doesn''t effect your server running.'\n" +
- " label:\n" +
- " unstable: '[Unstable]'\n" +
- " stable: '[Stable]'\n" +
- " lts: '[LTS]'\n" +
- " qualityverifyed: '[Quality]'\n" +
- " github: '[Github]'\n" +
- " spigotmc: '[SpigotMC]'\n" +
- " bukkitdev: '[BukkitDev]'\n" +
- "shop-removed-cause-ongoing-fee: '&cYou shop at {0} was removed cause you had no enough\n" +
- " money to keep it!'\n" +
- "test:\n" +
- " list:\n" +
- " - test\n" +
- " int: 13\n" +
- " boolean: true\n" +
- " short: 1\n" +
- " long: 1\n" +
- " byte: 1\n" +
- " double: 1.0\n" +
- " section: {}\n" +
- " test: test\n" +
- " test123: test";
-
-}
diff --git a/src/test/java/org/maxgamer/quickshop/QuickShopTest.java b/src/test/java/org/maxgamer/quickshop/QuickShopTest.java
deleted file mode 100644
index 1bfdeab6f..000000000
--- a/src/test/java/org/maxgamer/quickshop/QuickShopTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.maxgamer.quickshop;
-
-import org.bukkit.plugin.PluginDescriptionFile;
-import org.bukkit.plugin.java.JavaPlugin;
-import org.bukkit.plugin.java.JavaPluginLoader;
-
-import java.io.File;
-
-public final class QuickShopTest extends JavaPlugin {
-
- public QuickShopTest() {
- }
-
- public QuickShopTest(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
- super(loader, description, new File("build"), file);
- }
-
- @Override
- public void onLoad() {
-
- }
-
- @Override
- public void onEnable() {
-
- }
-
- @Override
- public void onDisable() {
-
- }
-}
diff --git a/src/test/resources/messages.json b/src/test/resources/messages.json
deleted file mode 100644
index f2c11970a..000000000
--- a/src/test/resources/messages.json
+++ /dev/null
@@ -1,231 +0,0 @@
-{
- "shop-staff-cleared": "&aSuccessfully removed all staff for your shop.",
- "failed-to-paste": "&cFailed to upload the data to Pastebin, Check your internet and try again. (See console for details)",
- "chest-was-removed": "&cThe chest was removed.",
- "thats-not-a-number": "&cInvalid number",
- "shop-already-owned": "&cThat is already a shop.",
- "buying-more-than-selling": "&cWARNING: You are buying items for more than you are selling them!",
- "signs": {
- "item": "{0}",
- "selling": "Selling {0}",
- "header": "&c{0}",
- "price": "{0} each",
- "unlimited": "Unlimited",
- "buying": "Buying {0}"
- },
- "price-too-high": "&c The shop price too high! You can't create one that is priced higher than {0}.",
- "no-pending-action": "&cYou do not have any pending action",
- "restricted-prices": "&cRestricted prices for {0}: min {1} , max {2}",
- "not-a-number": "&cThere can only be number, but you input {0}",
- "shop-purchase-cancelled": "&cCancelled Shop Purchase.",
- "updatenotify": {
- "onekeybuttontitle": "[OneKey Update]",
- "remote-disable-warning": "&cThis version of QuickShop is marked disabled by remote server, that mean this version may have serious problem, get details from our SpigotMC page: {0}. This warning will appear and spam your console until you use other not disabled version to replace this one, doesn't effect your server running.",
- "list": [
- "{0} is released, You are still using {1}!",
- "Boom! New update {0} incoming, Update!",
- "Surprise! {0} came out, you are on {1}",
- "Looks like you need to update, {0} is released!",
- "Ooops! {0} is now released, you are on {1}!",
- "I promise, QS has been updated to {0}, why have you not updated?",
- "Fixing and re... Sorry {0} is released!",
- "Err! Nope, this is not an error, {0} has just been released!",
- "OMG! {0} came out! Why are you still using {1}?",
- "Todays News: QuickShop has been updated to {0}!",
- "Plugin K.I.A, You should update to {0}!",
- "Fuze is fuzeing update {0}, save update!",
- "There is an update commander, {0} has just come out!",
- "Look me style---{0} updated, your still using {1}",
- "Ahhhhhhh! New update {0}! Update!",
- "What U thinking? {0} has been released! Update!"
- ],
- "buttontitle": "[Update Now]",
- "label": {
- "lts": "[LTS]",
- "bukkitdev": "[BukkitDev]",
- "github": "[Github]",
- "unstable": "[Unstable]",
- "stable": "[Stable]",
- "qualityverifyed": "[Quality]",
- "spigotmc": "[SpigotMC]"
- }
- },
- "no-anythings-in-your-hand": "&cThere is nothing in your hand.",
- "warn-to-paste": "&eCollecting data and uploading it to Pastebin, this may take a while. &c&lWarning&c, The data is kept public for one week, it may leak your server configuration and other sensitive information, make sure you only send it to your <rusted staff/developer.",
- "the-owner-cant-afford-to-buy-from-you": "&cThat costs {0} but the owner only has {1}",
- "menu": {
- "sell-tax-self": "&aYou own this shop so you don't pay taxes.",
- "this-shop-is-selling": "&aThis shop is &bSELLING&a items.",
- "successful-purchase": "&aSuccessfully Purchased:",
- "enchants": "&5Enchants",
- "item-name-and-price": "&e{0} {1} &afor &e{2}",
- "this-shop-is-buying": "&aThis shop is &dBUYING&a items.",
- "effects": "&aEffects: &e{0}",
- "owner": "&aOwner: {0}",
- "total-value-of-chest": "&aTotal value of Chest: &e{0}",
- "commands": {
- "preview": "/qs silentpreview {0} {1} {2} {3}"
- },
- "price-per": "&aPrice per &e{0} &a- &e{1}",
- "space": "&aSpace: &e{0}",
- "sell-tax": "&aYou paid &e{0} &ain taxes.",
- "stored-enchants": "&5Stored Enchants",
- "item": "&aItem: &e{0}",
- "successfully-sold": "&aSuccessfully Sold:",
- "preview": "&b[Preview Item]",
- "damage-percent-remaining": "&e{0}% &aRemaining.",
- "shop-information": "&aShop Information:",
- "stock": "&aStock &e{0}"
- },
- "player-bought-from-your-store": "&c{0} purchased {1} {2} from your store.",
- "no-price-given": "&cPlease give a valid price.",
- "booleanformat": {
- "failed": "&c\u2718",
- "success": "&a\u2714"
- },
- "blacklisted-item": "&cThat item is blacklisted. You may not sell it",
- "success-created-shop": "&aCreated shop.",
- "shop-has-no-space": "&cThe shop only has room for {0} more {1}.",
- "no-creative-break": "&cYou cannot break other players shops in creative mode. Use survival instead.",
- "translation-version": "&c&lSupport Version: &b&lReremake",
- "how-much-to-trade-for": "&aEnter how much you wish to trade one &e{0}&a for in chat.",
- "shop-has-changed": "&cThe shop you tried to use has changed since you clicked it!",
- "not-a-integer": "&cThere can only be integer, but you input {0}",
- "success-change-owner-to-server": "&aSuccessfully set the shop owner to Server.",
- "not-looking-at-shop": "&cNo QuickShop was found, you must be looking at one.",
- "you-dont-have-that-many-items": "&cYou only have {0} {1}.",
- "language-version": 24,
- "shop-not-exist": "&cThere had no shop.",
- "translation-country": "&c&lLanguage Zone: &b&lEnglish (en_US)",
- "unknown-player": "&cTarget player doesn't exist, please check the username you typed.",
- "you-cant-afford-to-change-price": "&cIt costs {0} to change the price in your shop.",
- "negative-amount": "&cDerp, can't trade negative amounts",
- "success-removed-shop": "&aShop removed.",
- "how-many-sell": "&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available. Enter &ball&a to sell them all.",
- "you-cant-afford-a-new-shop": "&cIt costs {0} to create a new shop.",
- "shop-creation-cancelled": "&cCancelled Shop Creation.",
- "owner-bypass-check": "&eBypassed all checks, Trade successful! (You are shop owner)",
- "tableformat": {
- "left_half_line": "+--------------------",
- "right_half_line": "--------------------+",
- "full_line": "+---------------------------------------------------+",
- "left_begin": "| "
- },
- "shop-staff-deleted": "&aSuccessfully removed {0} from your shop staffs.",
- "that-is-locked": "&cThat shop is locked.",
- "no-nearby-shop": "&cNo shops matching {0} nearby.",
- "you-cant-create-shop-in-there": "&cYou don't have permission to create a shop at this location.",
- "shop-stock-too-low": "&cThe shop only has {0} {1} left",
- "fee-charged-for-price-change": "&aYou pay &c{0}&a to change the price.",
- "how-many-buy": "&aEnter how many you wish to &bBUY&a in chat. You can buy &e{0}&a. Enter &ball&a to buy them all.",
- "failed-to-put-sign": "&cNot enough space around the shop to place the information sign.",
- "controlpanel": {
- "mode-buying-hover": "&eClick to convert the shop to be in the selling mode.",
- "refill-hover": "&eClick to refill the shop.",
- "empty-hover": "&eClick to clear the inventory of the shop.",
- "price": "&aPrice: &b{0} &e[&d&lSet&e]",
- "unlimited": "&aUnlimited: {0} &e[&d&lSwitch&e]",
- "price-hover": "&eClick to set a new price for the shop.",
- "setowner-hover": "&eClick to switch owner.",
- "setowner": "&aOwner: &b{0} &e[&d&lChange&e]",
- "unlimited-hover": "&eClick to toggle if the shop is unlimited.",
- "mode-buying": "&aShop mode: &bBuying &e[&d&lSwitch&e]",
- "refill": "&aRefill: Refill the shop items &e[&d&lOK&e]",
- "mode-selling-hover": "&eClick to convert the shop to be in the buying mode.",
- "commands": {
- "sell": "/qs silentsell {0} {1} {2} {3}",
- "buy": "/qs silentbuy {0} {1} {2} {3}",
- "price": "/qs price [New Price]",
- "unlimited": "/qs silentunlimited {0} {1} {2} {3}",
- "remove": "/qs silentremove {0} {1} {2} {3}",
- "setowner": "/qs setowner [Player]",
- "refill": "/qs refill [Amount]",
- "empty": "/qs silentempty {0} {1} {2} {3}"
- },
- "remove": "&c&l[Remove Shop]",
- "infomation": "&aShop Control Panel:",
- "mode-selling": "&aShop mode: &bSelling &e[&d&lSwitch&e]",
- "remove-hover": "&eClick to remove this shop.",
- "empty": "&aEmpty: Remove shop all items &e[&d&lOK&e]"
- },
- "permission-denied-3rd-party": "&cPermission denied: 3rd party plugin [{0}].",
- "not-enough-space": "&cYou only have room for {0} more of that!",
- "average-price-nearby": "&aAverage Price Nearby: &e{0}",
- "not-allowed-to-create": "&cYou may not create a shop here.",
- "price-too-cheap": "&cPrice must be greater than &e${0}",
- "shop-removed-cause-ongoing-fee": "&cYou shop at {0} was removed cause you had no enough money to keep it!",
- "player-sold-to-your-store": "&a{0} sold {1} {2} to your store.",
- "no-enough-money-to-keep-shops": "&cYou didn't have enough money to keep your shops! All shops have now been removed...",
- "shop-staff-added": "&aSuccessfully added {0} to your shop staffs.",
- "nothing-to-flush": "&aYou had no new shop message.",
- "empty-success": "&aEmpty success",
- "flush-finished": "&aSuccessfully flushed the messages.",
- "unknown-owner": "Unknown",
- "bypassing-lock": "&cBypassing a QuickShop lock!",
- "nearby-shop-this-way": "&aShop is {0} blocks away from you.",
- "no-double-chests": "&cYou cannot create the DoubleChest shop.",
- "shop-out-of-stock": "&5Your shop at {0}, {1}, {2}, has run out of {3}",
- "purchase-failed": "&cPurchase failed: Internal Error, please contact the server administrator.",
- "price-is-now": "&aThe shops new price is &e{0}",
- "reached-maximum-can-create": "&cYou have already created a maximum of {0}/{1} shops!",
- "no-permission": "&cYou do not have permission to do that.",
- "shop-out-of-space": "&5Your shop at {0}, {1}, {2}, is now full.",
- "player-bought-from-your-store-tax": "&c{0} purchased {1} {2} from your store, and you paid {3} in taxes.",
- "no-permission-build": "&cYou can't build a shop here.",
- "refill-success": "&aRefill success",
- "translation-author": "&c&lTranslator: &b&lGhost_chu",
- "break-shop-use-supertool": "&eYou can break the shop by using the SuperTool.",
- "translation-contributors": "&c&lContributors: &b&lTimtower, Netherfoam, KaiNoMood and Mgazul",
- "command": {
- "toggle-unlimited": {
- "limited": "&aShop is now limited",
- "unlimited": "&aShop is now unlimited"
- },
- "no-type-given": "&cUsage: /qs find
- ",
- "description": {
- "info": "&eShow QuickShop Statistics",
- "buy": "&eConverts a shop to &dBUY&e mode",
- "help": "&eShow QuickShop helps",
- "price": "&eChanges the buy/selling price of one of your shops",
- "unlimited": "&eMakes a shop unlimited",
- "about": "&eShow QuickShop abouts",
- "setowner": "&eChanges who owns a shop",
- "owner": "&eChanges who owns a shop",
- "refill": "&eAdds a given number of items to a shop",
- "paste": "&eAuto upload server data to Pastebin",
- "find": "&eLocates the nearest shop of a specific type.",
- "staff": "&eManage your shop staffs",
- "sell": "&eConverts a shop to &bSELL&e mode",
- "supercreate": "&eCreate a shop bypass all protection checks",
- "title": "&aQuickShop Help",
- "create": "&eCreates a new shop at the target chest",
- "remove": "&eRemove your looking the shop",
- "reload": "&eReloads the config.yml for QuickShop",
- "amount": "&eExecute for your actions with amount(For chat plugin issue)",
- "clean": "&eRemoves all (loaded) shops with 0 stock",
- "debug": "&eSwitch to developer mode",
- "fetchmessage": "&eFetch unread shop message",
- "empty": "&eRemoves all stock from a shop"
- },
- "new-owner": "&aNew owner: &e{0}",
- "now-buying": "&aNow &dBUYING&a &e{0}",
- "now-selling": "&aNow &bSELLING &e{0}",
- "no-owner-given": "&cNo owner given. Use &a/qs setowner &c",
- "no-amount-given": "&cNo amount given. Use &a/qs refill &c",
- "reloading": "&aReloading...",
- "cleaning": "&aCleaning up shops with 0 stock...",
- "now-nolonger-debuging": "&aSuccessfully switched to production mode, Reloading QuickShop...",
- "cleaned": "&aCleaned &e{0}&a shops",
- "now-debuging": "&aSuccessfully switched to developer mode, Reloading QuickShop...",
- "wrong-args": "&cParameters don't match, use /qs help to check help"
- },
- "no-price-change": "&cThat wouldn't result in a price change!",
- "shops-arent-locked": "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!",
- "admin-shop": "AdminShop",
- "you-cant-afford-to-buy": "&cThat costs {0}, but you only have {1}",
- "tabcomplete": {
- "range": "[range]",
- "amount": "[amount]",
- "price": "[price]"
- }
-}
\ No newline at end of file
diff --git a/src/test/resources/messages.yml b/src/test/resources/messages.yml
deleted file mode 100644
index ff38da8fc..000000000
--- a/src/test/resources/messages.yml
+++ /dev/null
@@ -1,234 +0,0 @@
-# Colors:
-# &0-9, &a-f
-# {0}, {1}, {2}, etc are variables. You can swap them around, but adding a new variable won't work. Removing them will work
-
-# Translate data.
-# ======================================================================
-# For Translator: These string can changed by your self.
-translation-author: "&c&lTranslator: &b&lGhost_chu"
-translation-contributors: "&c&lContributors: &b&lTimtower, Netherfoam, KaiNoMood and Mgazul"
-translation-version: "&c&lSupport Version: &b&lReremake"
-translation-country: "&c&lLanguage Zone: &b&lEnglish (en_US)"
-# ======================================================================
-
-language-version: 24
-
-not-looking-at-shop: "&cNo QuickShop was found, you must be looking at one."
-no-anythings-in-your-hand: "&cThere is nothing in your hand."
-no-permission: "&cYou do not have permission to do that."
-no-creative-break: "&cYou cannot break other players shops in creative mode. Use survival instead."
-no-double-chests: "&cYou cannot create the DoubleChest shop."
-shop-already-owned: "&cThat is already a shop."
-chest-was-removed: "&cThe chest was removed."
-price-too-cheap: "&cPrice must be greater than &e${0}"
-no-price-change: "&cThat wouldn't result in a price change!"
-you-cant-afford-a-new-shop: "&cIt costs {0} to create a new shop."
-player-bought-from-your-store-tax: "&c{0} purchased {1} {2} from your store, and you paid {3} in taxes."
-you-cant-afford-to-change-price: "&cIt costs {0} to change the price in your shop."
-success-created-shop: "&aCreated shop."
-success-removed-shop: "&aShop removed."
-shops-arent-locked: "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!"
-shop-creation-cancelled: "&cCancelled Shop Creation."
-shop-purchase-cancelled: "&cCancelled Shop Purchase."
-shop-stock-too-low: "&cThe shop only has {0} {1} left"
-you-cant-afford-to-buy: "&cThat costs {0}, but you only have {1}"
-negative-amount: "&cDerp, can't trade negative amounts"
-not-a-number: "&cThere can only be number, but you input {0}"
-not-a-integer: "&cThere can only be integer, but you input {0}"
-player-bought-from-your-store: "&c{0} purchased {1} {2} from your store."
-shop-out-of-stock: "&5Your shop at {0}, {1}, {2}, has run out of {3}"
-shop-has-no-space: "&cThe shop only has room for {0} more {1}."
-you-dont-have-that-many-items: "&cYou only have {0} {1}."
-the-owner-cant-afford-to-buy-from-you: "&cThat costs {0} but the owner only has {1}"
-player-sold-to-your-store: "&a{0} sold {1} {2} to your store."
-shop-out-of-space: "&5Your shop at {0}, {1}, {2}, is now full."
-fee-charged-for-price-change: "&aYou pay &c{0}&a to change the price."
-price-is-now: "&aThe shops new price is &e{0}"
-thats-not-a-number: "&cInvalid number"
-no-price-given: "&cPlease give a valid price."
-average-price-nearby: "&aAverage Price Nearby: &e{0}"
-shop-has-changed: "&cThe shop you tried to use has changed since you clicked it!"
-shop-not-exist: "&cThere had no shop."
-nearby-shop-this-way: "&aShop is {0} blocks away from you."
-no-nearby-shop: "&cNo shops matching {0} nearby."
-buying-more-than-selling: "&cWARNING: You are buying items for more than you are selling them!"
-not-enough-space: "&cYou only have room for {0} more of that!"
-refill-success: "&aRefill success"
-empty-success: "&aEmpty success"
-admin-shop: "AdminShop"
-unknown-owner: "Unknown"
-owner-bypass-check: "&eBypassed all checks, Trade successful! (You are shop owner)"
-reached-maximum-can-create: "&cYou have already created a maximum of {0}/{1} shops!"
-restricted-prices: "&cRestricted prices for {0}: min {1} , max {2}"
-no-enough-money-to-keep-shops: "&cYou didn't have enough money to keep your shops! All shops have now been removed..."
-nothing-to-flush: "&aYou had no new shop message."
-break-shop-use-supertool: "&eYou can break the shop by using the SuperTool."
-failed-to-put-sign: "&cNot enough space around the shop to place the information sign."
-failed-to-paste: "&cFailed to upload the data to Pastebin, Check your internet and try again. (See console for details)"
-warn-to-paste: "&eCollecting data and uploading it to Pastebin, this may take a while. &c&lWarning&c, The data is kept public for one week, it may leak your server configuration and other sensitive information, make sure you only send it to your <rusted staff/developer."
-price-too-high: "&c The shop price too high! You can't create one that is priced higher than {0}."
-you-cant-create-shop-in-there: "&cYou don't have permission to create a shop at this location."
-unknown-player: "&cTarget player doesn't exist, please check the username you typed."
-shop-staff-cleared: "&aSuccessfully removed all staff for your shop."
-shop-staff-added: "&aSuccessfully added {0} to your shop staffs."
-shop-staff-deleted: "&aSuccessfully removed {0} from your shop staffs."
-no-permission-build: "&cYou can't build a shop here."
-success-change-owner-to-server: "&aSuccessfully set the shop owner to Server."
-flush-finished: "&aSuccessfully flushed the messages."
-purchase-failed: "&cPurchase failed: Internal Error, please contact the server administrator."
-no-pending-action: "&cYou do not have any pending action"
-permission-denied-3rd-party: "&cPermission denied: 3rd party plugin [{0}]."
-menu:
- successful-purchase: "&aSuccessfully Purchased:"
- successfully-sold: "&aSuccessfully Sold:"
- item-name-and-price: "&e{0} {1} &afor &e{2}"
- sell-tax: "&aYou paid &e{0} &ain taxes."
- sell-tax-self: "&aYou own this shop so you don't pay taxes."
- enchants: "&5Enchants"
- stored-enchants: "&5Stored Enchants"
- shop-information: "&aShop Information:"
- owner: "&aOwner: {0}"
- item: "&aItem: &e{0}"
- preview: "&b[Preview Item]"
- space: "&aSpace: &e{0}"
- stock: "&aStock &e{0}"
- price-per: "&aPrice per &e{0} &a- &e{1}"
- total-value-of-chest: "&aTotal value of Chest: &e{0}"
- damage-percent-remaining: "&e{0}% &aRemaining."
- this-shop-is-buying: "&aThis shop is &dBUYING&a items."
- this-shop-is-selling: "&aThis shop is &bSELLING&a items."
- effects: "&aEffects: &e{0}"
- commands:
- preview: "/qs silentpreview {0} {1} {2} {3}"
-
-bypassing-lock: "&cBypassing a QuickShop lock!"
-that-is-locked: "&cThat shop is locked."
-
-how-many-buy: "&aEnter how many you wish to &bBUY&a in chat. You can buy &e{0}&a. Enter &ball&a to buy them all."
-how-many-sell: "&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available. Enter &ball&a to sell them all."
-
-not-allowed-to-create: "&cYou may not create a shop here."
-blacklisted-item: "&cThat item is blacklisted. You may not sell it"
-how-much-to-trade-for: "&aEnter how much you wish to trade one &e{0}&a for in chat."
-
-command:
- toggle-unlimited:
- unlimited: "&aShop is now unlimited"
- limited: "&aShop is now limited"
- no-owner-given: "&cNo owner given. Use &a/qs setowner &c"
- new-owner: "&aNew owner: &e{0}"
- now-buying: "&aNow &dBUYING&a &e{0}"
- now-selling: "&aNow &bSELLING &e{0}"
- cleaning: "&aCleaning up shops with 0 stock..."
- reloading: "&aReloading..."
- cleaned: "&aCleaned &e{0}&a shops"
- no-type-given: "&cUsage: /qs find
- "
- no-amount-given: "&cNo amount given. Use &a/qs refill &c"
- now-debuging: "&aSuccessfully switched to developer mode, Reloading QuickShop..."
- now-nolonger-debuging: "&aSuccessfully switched to production mode, Reloading QuickShop..."
- wrong-args: "&cParameters don't match, use /qs help to check help"
- description:
- title: "&aQuickShop Help"
- unlimited: "&eMakes a shop unlimited"
- setowner: "&eChanges who owns a shop"
- owner: "&eChanges who owns a shop"
- buy: "&eConverts a shop to &dBUY&e mode"
- sell: "&eConverts a shop to &bSELL&e mode"
- clean: "&eRemoves all (loaded) shops with 0 stock"
- price: "&eChanges the buy/selling price of one of your shops"
- find: "&eLocates the nearest shop of a specific type."
- reload: "&eReloads the config.yml for QuickShop"
- refill: "&eAdds a given number of items to a shop"
- empty: "&eRemoves all stock from a shop"
- create: "&eCreates a new shop at the target chest"
- debug: "&eSwitch to developer mode"
- fetchmessage: "&eFetch unread shop message"
- info: "&eShow QuickShop Statistics"
- paste: "&eAuto upload server data to Pastebin"
- staff: "&eManage your shop staffs"
- remove: "&eRemove your looking the shop"
- amount: "&eExecute for your actions with amount(For chat plugin issue)"
- about: "&eShow QuickShop abouts"
- help: "&eShow QuickShop helps"
- supercreate: "&eCreate a shop bypass all protection checks"
-
-signs:
- header: "&c{0}"
- selling: "Selling {0}"
- buying: "Buying {0}"
- item: "{0}"
- price: "{0} each"
- unlimited: "Unlimited"
-controlpanel:
- infomation: "&aShop Control Panel:"
- setowner: "&aOwner: &b{0} &e[&d&lChange&e]"
- setowner-hover: "&eClick to switch owner."
- unlimited: "&aUnlimited: {0} &e[&d&lSwitch&e]"
- unlimited-hover: "&eClick to toggle if the shop is unlimited."
- mode-selling: "&aShop mode: &bSelling &e[&d&lSwitch&e]"
- mode-selling-hover: "&eClick to convert the shop to be in the buying mode."
- mode-buying: "&aShop mode: &bBuying &e[&d&lSwitch&e]"
- mode-buying-hover: "&eClick to convert the shop to be in the selling mode."
- price: "&aPrice: &b{0} &e[&d&lSet&e]"
- price-hover: "&eClick to set a new price for the shop."
- refill: "&aRefill: Refill the shop items &e[&d&lOK&e]"
- refill-hover: "&eClick to refill the shop."
- empty: "&aEmpty: Remove shop all items &e[&d&lOK&e]"
- empty-hover: "&eClick to clear the inventory of the shop."
- remove: "&c&l[Remove Shop]"
- remove-hover: "&eClick to remove this shop."
- commands:
- setowner: "/qs setowner [Player]"
- unlimited: "/qs silentunlimited {0} {1} {2} {3}"
- buy: "/qs silentbuy {0} {1} {2} {3}"
- sell: "/qs silentsell {0} {1} {2} {3}"
- price: "/qs price [New Price]"
- refill: "/qs refill [Amount]"
- empty: "/qs silentempty {0} {1} {2} {3}"
- remove: "/qs silentremove {0} {1} {2} {3}"
-tableformat:
- full_line: "+---------------------------------------------------+"
- left_half_line: "+--------------------"
- right_half_line: "--------------------+"
- left_begin: "| "
-booleanformat:
- success: "&a✔"
- failed: "&c✘"
-tabcomplete:
- # /qs price [price] or /qs create [price]
- price: "[price]"
- # /qs find [range]
- range: "[range]"
- # /qs refill [amount]
- amount: "[amount]"
-
-updatenotify:
- buttontitle: "[Update Now]"
- onekeybuttontitle: "[OneKey Update]"
- list:
- - "{0} is released, You are still using {1}!"
- - "Boom! New update {0} incoming, Update!"
- - "Surprise! {0} came out, you are on {1}"
- - "Looks like you need to update, {0} is released!"
- - "Ooops! {0} is now released, you are on {1}!"
- - "I promise, QS has been updated to {0}, why have you not updated?"
- - "Fixing and re... Sorry {0} is released!"
- - "Err! Nope, this is not an error, {0} has just been released!"
- - "OMG! {0} came out! Why are you still using {1}?"
- - "Todays News: QuickShop has been updated to {0}!"
- - "Plugin K.I.A, You should update to {0}!"
- - "Fuze is fuzeing update {0}, save update!"
- - "There is an update commander, {0} has just come out!"
- - "Look me style---{0} updated, your still using {1}"
- - "Ahhhhhhh! New update {0}! Update!"
- - "What U thinking? {0} has been released! Update!"
- remote-disable-warning: "&cThis version of QuickShop is marked disabled by remote server, that mean this version may have serious problem, get details from our SpigotMC page: {0}. This warning will appear and spam your console until you use other not disabled version to replace this one, doesn't effect your server running."
- label:
- unstable: "[Unstable]"
- stable: "[Stable]"
- lts: "[LTS]"
- qualityverifyed: "[Quality]"
- github: "[Github]"
- spigotmc: "[SpigotMC]"
- bukkitdev: "[BukkitDev]"
-shop-removed-cause-ongoing-fee: "&cYou shop at {0} was removed cause you had no enough money to keep it!"
diff --git a/src/test/resources/plugin.yml b/src/test/resources/plugin.yml
deleted file mode 100644
index 86bf7fbf0..000000000
--- a/src/test/resources/plugin.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: QuickShopTest
-main: org.maxgamer.quickshop.QuickShopTest
-version: 1.0
\ No newline at end of file