list = new ArrayList<>();
/**
* Creates the list with a type and a series of elements.
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLong.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLong.java
similarity index 87%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLong.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLong.java
index 0d2a50a..33cca56 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLong.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLong.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
/**
* The {@code TAG_Long} tag.
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLongArray.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLongArray.java
similarity index 91%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLongArray.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLongArray.java
index 9a4ff37..d605bc1 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTLongArray.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTLongArray.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
import java.util.Arrays;
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTShort.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTShort.java
similarity index 87%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTShort.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTShort.java
index c998834..5287a78 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTShort.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTShort.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
/**
* The {@code TAG_Short} tag.
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTString.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTString.java
similarity index 90%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTString.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTString.java
index 4c21ec0..7a8572a 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTString.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTString.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
/**
* The {@code TAG_String} tag.
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTTag.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTTag.java
similarity index 89%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTTag.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTTag.java
index 89619ae..e57168c 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTTag.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTTag.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
/**
* An abstract NBT-Tag.
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTType.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTType.java
similarity index 96%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTType.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTType.java
index 218e650..636d9e9 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/NBTType.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/NBTType.java
@@ -1,4 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt;
/**
*
@@ -167,7 +172,7 @@ public enum NBTType {
/**
* Returns whether this tag type is primitive, meaning that it is not a {@link NBTByteArray}, {@link NBTIntArray},
- * {@link NBTList}, {@link NBTCompound} or {@link NBTEnd}.
+ * {@link NBTList}, {@link NBTCompound}.
*
* @return whether this type is numeric
*/
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java
similarity index 72%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java
index c061619..3fd8cac 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParseException.java
@@ -1,6 +1,9 @@
-package com.gmail.filoghost.chestcommands.util.nbt.parser;
-
-import org.bukkit.ChatColor;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt.parser;
import java.io.IOException;
@@ -18,8 +21,8 @@ public class MojangsonParseException extends IOException {
if (i > 35) {
builder.append("...");
}
- builder.append(content.substring(Math.max(0, i - 35), i));
- builder.append(ChatColor.GOLD + "<--[HERE]");
+ builder.append(content, Math.max(0, i - 35), i);
+ builder.append("<--[HERE]");
return builder.toString();
}
diff --git a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java
similarity index 91%
rename from Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java
rename to plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java
index a08a744..e07a864 100644
--- a/Plugin/src/main/java/com/gmail/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java
+++ b/plugin/src/main/java/me/filoghost/chestcommands/util/nbt/parser/MojangsonParser.java
@@ -1,6 +1,24 @@
-package com.gmail.filoghost.chestcommands.util.nbt.parser;
+/*
+ * Copyright (C) Jan Schultke
+ *
+ * SPDX-License-Identifier: MIT
+ */
+package me.filoghost.chestcommands.util.nbt.parser;
-import com.gmail.filoghost.chestcommands.util.nbt.*;
+import me.filoghost.chestcommands.util.nbt.NBTByte;
+import me.filoghost.chestcommands.util.nbt.NBTByteArray;
+import me.filoghost.chestcommands.util.nbt.NBTCompound;
+import me.filoghost.chestcommands.util.nbt.NBTDouble;
+import me.filoghost.chestcommands.util.nbt.NBTFloat;
+import me.filoghost.chestcommands.util.nbt.NBTInt;
+import me.filoghost.chestcommands.util.nbt.NBTIntArray;
+import me.filoghost.chestcommands.util.nbt.NBTList;
+import me.filoghost.chestcommands.util.nbt.NBTLong;
+import me.filoghost.chestcommands.util.nbt.NBTLongArray;
+import me.filoghost.chestcommands.util.nbt.NBTShort;
+import me.filoghost.chestcommands.util.nbt.NBTString;
+import me.filoghost.chestcommands.util.nbt.NBTTag;
+import me.filoghost.chestcommands.util.nbt.NBTType;
import java.util.ArrayList;
import java.util.List;
@@ -230,7 +248,7 @@ public final class MojangsonParser {
}
private Number[] parseNumArray(NBTType arrayType, NBTType primType) throws MojangsonParseException {
- List result = new ArrayList();
+ List result = new ArrayList<>();
while (currentChar() != ']') {
NBTTag element = parseAnything();
NBTType elementType = element.getType();
@@ -254,7 +272,7 @@ public final class MojangsonParser {
}
expectChar(']');
- return result.toArray(new Number[result.size()]);
+ return result.toArray(new Number[0]);
}
// CHARACTER NAVIGATION
diff --git a/plugin/src/main/resources/custom-placeholders.yml b/plugin/src/main/resources/custom-placeholders.yml
new file mode 100644
index 0000000..afd0b34
--- /dev/null
+++ b/plugin/src/main/resources/custom-placeholders.yml
@@ -0,0 +1,14 @@
+#
+# This is the configuration file for custom placeholders.
+# Dynamic placeholders are {online}, {max_players}, ...
+#
+# You can use these to avoid repeating text multiple times,
+# and edit it from a single location.
+#
+# Another use would be for defining colors, symbols, or text decorations.
+#
+placeholders:
+ '{custom_placeholder}': 'This line is a custom placeholder.'
+ '{primary_color}': '&b'
+ '{secondary_color}': '&7'
+ '{separator}': '&8[====|====|====|====|====|====|====|====]'
\ No newline at end of file
diff --git a/Plugin/src/main/resources/menu/example.yml b/plugin/src/main/resources/menu/example.yml
similarity index 86%
rename from Plugin/src/main/resources/menu/example.yml
rename to plugin/src/main/resources/menu/example.yml
index e33680e..ec71c79 100644
--- a/Plugin/src/main/resources/menu/example.yml
+++ b/plugin/src/main/resources/menu/example.yml
@@ -21,12 +21,12 @@ menu-settings:
# OPTIONAL
# How frequently the menu will be refreshed, in seconds.
- # Useful if you have variables in icon descriptions.
+ # Useful if you have placeholders in icon descriptions.
auto-refresh: 5
# OPTIONAL
- # This command command will be executed when the menu is opened.
- # Supports all the icon command types.
+ # These actions will be executed when the menu is opened.
+ # Supports all the icon action types.
open-actions:
- 'tell: &eYou opened the example menu.'
@@ -129,16 +129,18 @@ economy-give:
MATERIAL: gold ingot
POSITION-X: 8
POSITION-Y: 1
- NAME: '&eEconomy & Give command'
+ NAME: '&eEconomy & Give action'
LORE:
- - 'This command will be executed'
+ - 'This action will be executed'
- 'only if you have at least 50$.'
- 'It gives you a gold ingot.'
+ - ''
+ - 'Current money: {money}'
PRICE: 50
ACTIONS:
- 'tell: &aYou have paid 50$'
- 'give: gold ingot'
-
+ KEEP-OPEN: true
economy-take:
MATERIAL: gold ingot
@@ -146,13 +148,16 @@ economy-take:
POSITION-Y: 1
NAME: '&eEconomy & Required item'
LORE:
- - 'This command is the opposite of the previous.'
+ - 'This icon is the opposite of the previous.'
- 'It will take you a gold ingot and give you $50.'
+ - ''
+ - 'Current money: {money}'
REQUIRED-ITEMS:
- gold ingot
ACTIONS:
- 'tell: &aYou have been paid 50$'
- 'give-money: 50'
+ KEEP-OPEN: true
formatting-codes:
@@ -219,6 +224,19 @@ nbt-tags:
NBT-DATA: '{display: {color: 8910400}}'
+custom-placeholder:
+ MATERIAL: compass
+ POSITION-X: 6
+ POSITION-Y: 2
+ NAME: '{primary_color}Custom placeholders'
+ LORE:
+ - '{separator}'
+ - '{secondary_color}This item contains custom placeholders,'
+ - '{secondary_color}defined in custom-placeholders.yml.'
+ - ''
+ - '{custom_placeholder}'
+
+
close-without-actions:
MATERIAL: redstone lamp
POSITION-X: 9
diff --git a/Plugin/src/main/resources/plugin.yml b/plugin/src/main/resources/plugin.yml
similarity index 79%
rename from Plugin/src/main/resources/plugin.yml
rename to plugin/src/main/resources/plugin.yml
index 5ad1b3c..eb33aed 100644
--- a/Plugin/src/main/resources/plugin.yml
+++ b/plugin/src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
name: ChestCommands
-main: com.gmail.filoghost.chestcommands.ChestCommands
-version: ${project.version}
+main: me.filoghost.chestcommands.ChestCommands
+version: ${project.pluginVersion}
api-version: 1.13
softdepend: [Vault, BarAPI, PlaceholderAPI]
diff --git a/pom.xml b/pom.xml
index aaba725..04da293 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,10 +3,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- com.gmail.filoghost.chestcommands
+ me.filoghost.chestcommands
chestcommands-parent
ChestCommands Parent
- 3.3.1
+ 4.0.0-SNAPSHOT
pom
https://dev.bukkit.org/bukkit-plugins/chest-commands
@@ -17,24 +17,119 @@
scm:git:git@github.com:filoghost/ChestCommands.git
+
+
+ GNU General Public License, Version 3
+ https://www.gnu.org/licenses/gpl-3.0.txt
+ repo
+
+
+
UTF-8
- 1.6
- 1.6
+ 1.8
+ 1.8
true
- 1.8.8-R0.1-SNAPSHOT
- Plugin
-
+ commons
+ api
+ plugin
+
+
+
+
+ spigot-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
+
+ vault-repo
+ http://nexus.hc.to/content/repositories/pub_releases
+
+
+
+ confuser-repo
+ https://ci.frostcast.net/plugin/repository/everything/
+
+
+
+ codemc-repo
+ https://repo.codemc.io/repository/maven-public/
+
+
+
+ placeholderapi-repo
+ https://repo.extendedclip.com/content/repositories/placeholderapi/
+
+
+
+
+
+
+ org.bukkit
+ bukkit
+ 1.8-R0.1-SNAPSHOT
+ provided
+
+
+
+ net.milkbowl.vault
+ VaultAPI
+ 1.6
+ provided
+
+
+
+ me.confuser
+ BarAPI
+ 3.5
+ provided
+
+
+
+ me.clip
+ placeholderapi
+ 2.9.2
+ provided
+
+
+
+ org.bstats
+ bstats-bukkit-lite
+ 1.7
+
+
+
+ me.filoghost.updatechecker
+ updatechecker
+ 1.0.1
+
+
+
+ ${project.groupId}
+ chestcommands-api
+ ${project.version}
+
+
+
+ ${project.groupId}
+ chestcommands-commons
+ ${project.version}
+
+
+
+ clean package
+
org.apache.maven.plugins
maven-jar-plugin
+ 3.2.0
false
@@ -44,8 +139,77 @@
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.2.3
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0-M3
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 3.0.0
+
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ [0.0,)
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+
+ enforce
+
+
+
+
+
+ [3.6.0,)
+
+
+ [1.8,)
+
+
+
+
+
+
+