diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 0a4d5524..7b886859 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -11,7 +11,7 @@ jobs: steps: # 1. Check out the current working tree - name: Checkout ArmorStandEditor Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis @@ -53,7 +53,7 @@ jobs: #6 Upload Artifacts (Debug Purposes) - name: Upload Artifact for Debugging - uses: actions/upload-artifact@v2.3.1 + uses: actions/upload-artifact@v3.0.0 with: name: artifact path: /home/runner/work/ArmorStandEditor/ArmorStandEditor/target/armorstandeditor-*-*.jar diff --git a/README.md b/README.md index d1786f71..eb6f637b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ For versions older than 1.17, then please use [the original versions download pa The Latest Downloads Shortcut Links: * [Unstable 1.1x-DEV Versions](https://github.com/Wolfst0rm/ArmorStandEditor/actions) - **Use these at your own risk. Limited Support is provided for testing purposes** -* [1.18.1](https://www.spigotmc.org/threads/armorstandeditor-reborn.517132) +* [1.18.2](https://www.spigotmc.org/threads/armorstandeditor-reborn.517132) +* [1.18.1](https://github.com/Wolfieheart/ArmorStandEditor/releases/tag/1.18.1-33) * [1.18](https://github.com/Wolfst0rm/ArmorStandEditor/releases/tag/1.18-31) * [1.17.1](https://github.com/Wolfst0rm/ArmorStandEditor/releases/tag/1.17.1-30) * [1.17](https://github.com/Wolfst0rm/ArmorStandEditor/releases/tag/1.17.1-27) diff --git a/pom.xml b/pom.xml index 9a15b78b..5c928ec0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.github.rypofalem.armorstandeditor armorstandeditor jar - 1.18.1-33.1 + 1.18.2-34 armorstandeditor http://maven.apache.org @@ -24,14 +24,15 @@ + spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - jitpack.io - https://jitpack.io + glaremasters repo + https://repo.glaremasters.me/repository/towny/ @@ -45,14 +46,14 @@ org.spigotmc spigot-api - 1.18.1-R0.1-SNAPSHOT + 1.18.2-R0.1-SNAPSHOT provided - com.github.TownyAdvanced - Towny - 0.97.5.1 + com.palmergames.bukkit.towny + towny + 0.98.0.0 provided diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/ArmorStandEditorPlugin.java b/src/main/java/io/github/rypofalem/armorstandeditor/ArmorStandEditorPlugin.java index ff34bcb3..d1f44381 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/ArmorStandEditorPlugin.java +++ b/src/main/java/io/github/rypofalem/armorstandeditor/ArmorStandEditorPlugin.java @@ -19,9 +19,12 @@ package io.github.rypofalem.armorstandeditor; -import de.jeff_media.updatechecker.*; import io.github.rypofalem.armorstandeditor.language.Language; -import io.github.rypofalem.armorstandeditor.Metrics.*; + +import de.jeff_media.updatechecker.*; + +import org.bstats.bukkit.Metrics; +import org.bstats.bukkit.Metrics.*; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -153,7 +156,6 @@ public void onEnable(){ nmsVersion.startsWith("v1_17")){ getLogger().warning("Minecraft Version: " + nmsVersion + " is supported, but not latest."); getLogger().warning("ArmorStandEditor will still work, but please update to the latest Version of " + nmsVersionNotLatest + ". Loading continuing."); - } else { getLogger().info("Minecraft Version: " + nmsVersion + " is supported. Loading continuing."); } getServer().getPluginManager().enablePlugin(this); diff --git a/src/main/java/io/github/rypofalem/armorstandeditor/Metrics.java b/src/main/java/org/bstats/bukkit/Metrics.java similarity index 97% rename from src/main/java/io/github/rypofalem/armorstandeditor/Metrics.java rename to src/main/java/org/bstats/bukkit/Metrics.java index 0f1481bd..0b2c7105 100644 --- a/src/main/java/io/github/rypofalem/armorstandeditor/Metrics.java +++ b/src/main/java/org/bstats/bukkit/Metrics.java @@ -1,4 +1,18 @@ -package io.github.rypofalem.armorstandeditor; +/* + * This Metrics class was auto-generated and can be copied into your project if you are + * not using a build tool like Gradle or Maven for dependency management. + * + * IMPORTANT: You are not allowed to modify this class, except changing the package. + * + * Unallowed modifications include but are not limited to: + * - Remove the option for users to opt-out + * - Change the frequency for data submission + * - Obfuscate the code (every obfucator should allow you to make an exception for specific files) + * - Reformat the code (if you use a linter, add an exception) + * + * Violations will result in a ban of your plugin and account from bStats. + */ +package org.bstats.bukkit; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; @@ -139,7 +153,7 @@ private int getPlayerAmount() { public static class MetricsBase { /** The version of the Metrics class. */ - public static final String METRICS_VERSION = "2.2.1"; + public static final String METRICS_VERSION = "3.0.0"; private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, task -> new Thread(task, "bStats-Metrics")); @@ -224,6 +238,7 @@ public MetricsBase( this.logResponseStatusText = logResponseStatusText; checkRelocation(); if (enabled) { + // WARNING: Removing the option to opt-out will get your plugin banned from bStats startSubmitting(); } } @@ -360,9 +375,9 @@ private static byte[] compress(final String str) throws IOException { } } - public static class AdvancedBarChart extends CustomChart { + public static class DrilldownPie extends CustomChart { - private final Callable> callable; + private final Callable>> callable; /** * Class constructor. @@ -370,29 +385,33 @@ public static class AdvancedBarChart extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public AdvancedBarChart(String chartId, Callable> callable) { + public DrilldownPie(String chartId, Callable>> callable) { super(chartId); this.callable = callable; } @Override - protected JsonObjectBuilder.JsonObject getChartData() throws Exception { + public JsonObjectBuilder.JsonObject getChartData() throws Exception { JsonObjectBuilder valuesBuilder = new JsonObjectBuilder(); - Map map = callable.call(); + Map> map = callable.call(); if (map == null || map.isEmpty()) { // Null = skip the chart return null; } - boolean allSkipped = true; - for (Map.Entry entry : map.entrySet()) { - if (entry.getValue().length == 0) { - // Skip this invalid - continue; + boolean reallyAllSkipped = true; + for (Map.Entry> entryValues : map.entrySet()) { + JsonObjectBuilder valueBuilder = new JsonObjectBuilder(); + boolean allSkipped = true; + for (Map.Entry valueEntry : map.get(entryValues.getKey()).entrySet()) { + valueBuilder.appendField(valueEntry.getKey(), valueEntry.getValue()); + allSkipped = false; + } + if (!allSkipped) { + reallyAllSkipped = false; + valuesBuilder.appendField(entryValues.getKey(), valueBuilder.build()); } - allSkipped = false; - valuesBuilder.appendField(entry.getKey(), entry.getValue()); } - if (allSkipped) { + if (reallyAllSkipped) { // Null = skip the chart return null; } @@ -400,7 +419,7 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception { } } - public static class SimpleBarChart extends CustomChart { + public static class AdvancedPie extends CustomChart { private final Callable> callable; @@ -410,7 +429,7 @@ public static class SimpleBarChart extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public SimpleBarChart(String chartId, Callable> callable) { + public AdvancedPie(String chartId, Callable> callable) { super(chartId); this.callable = callable; } @@ -423,8 +442,18 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception { // Null = skip the chart return null; } + boolean allSkipped = true; for (Map.Entry entry : map.entrySet()) { - valuesBuilder.appendField(entry.getKey(), new int[] {entry.getValue()}); + if (entry.getValue() == 0) { + // Skip this invalid + continue; + } + allSkipped = false; + valuesBuilder.appendField(entry.getKey(), entry.getValue()); + } + if (allSkipped) { + // Null = skip the chart + return null; } return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build(); } @@ -470,7 +499,7 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception { } } - public static class AdvancedPie extends CustomChart { + public static class SimpleBarChart extends CustomChart { private final Callable> callable; @@ -480,7 +509,7 @@ public static class AdvancedPie extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public AdvancedPie(String chartId, Callable> callable) { + public SimpleBarChart(String chartId, Callable> callable) { super(chartId); this.callable = callable; } @@ -493,18 +522,8 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception { // Null = skip the chart return null; } - boolean allSkipped = true; for (Map.Entry entry : map.entrySet()) { - if (entry.getValue() == 0) { - // Skip this invalid - continue; - } - allSkipped = false; - valuesBuilder.appendField(entry.getKey(), entry.getValue()); - } - if (allSkipped) { - // Null = skip the chart - return null; + valuesBuilder.appendField(entry.getKey(), new int[] {entry.getValue()}); } return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build(); } @@ -544,9 +563,9 @@ public JsonObjectBuilder.JsonObject getRequestJsonObject( protected abstract JsonObjectBuilder.JsonObject getChartData() throws Exception; } - public static class SingleLineChart extends CustomChart { + public static class SimplePie extends CustomChart { - private final Callable callable; + private final Callable callable; /** * Class constructor. @@ -554,15 +573,15 @@ public static class SingleLineChart extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public SingleLineChart(String chartId, Callable callable) { + public SimplePie(String chartId, Callable callable) { super(chartId); this.callable = callable; } @Override protected JsonObjectBuilder.JsonObject getChartData() throws Exception { - int value = callable.call(); - if (value == 0) { + String value = callable.call(); + if (value == null || value.isEmpty()) { // Null = skip the chart return null; } @@ -570,9 +589,9 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception { } } - public static class SimplePie extends CustomChart { + public static class AdvancedBarChart extends CustomChart { - private final Callable callable; + private final Callable> callable; /** * Class constructor. @@ -580,25 +599,39 @@ public static class SimplePie extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public SimplePie(String chartId, Callable callable) { + public AdvancedBarChart(String chartId, Callable> callable) { super(chartId); this.callable = callable; } @Override protected JsonObjectBuilder.JsonObject getChartData() throws Exception { - String value = callable.call(); - if (value == null || value.isEmpty()) { + JsonObjectBuilder valuesBuilder = new JsonObjectBuilder(); + Map map = callable.call(); + if (map == null || map.isEmpty()) { // Null = skip the chart return null; } - return new JsonObjectBuilder().appendField("value", value).build(); + boolean allSkipped = true; + for (Map.Entry entry : map.entrySet()) { + if (entry.getValue().length == 0) { + // Skip this invalid + continue; + } + allSkipped = false; + valuesBuilder.appendField(entry.getKey(), entry.getValue()); + } + if (allSkipped) { + // Null = skip the chart + return null; + } + return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build(); } } - public static class DrilldownPie extends CustomChart { + public static class SingleLineChart extends CustomChart { - private final Callable>> callable; + private final Callable callable; /** * Class constructor. @@ -606,37 +639,19 @@ public static class DrilldownPie extends CustomChart { * @param chartId The id of the chart. * @param callable The callable which is used to request the chart data. */ - public DrilldownPie(String chartId, Callable>> callable) { + public SingleLineChart(String chartId, Callable callable) { super(chartId); this.callable = callable; } @Override - public JsonObjectBuilder.JsonObject getChartData() throws Exception { - JsonObjectBuilder valuesBuilder = new JsonObjectBuilder(); - Map> map = callable.call(); - if (map == null || map.isEmpty()) { - // Null = skip the chart - return null; - } - boolean reallyAllSkipped = true; - for (Map.Entry> entryValues : map.entrySet()) { - JsonObjectBuilder valueBuilder = new JsonObjectBuilder(); - boolean allSkipped = true; - for (Map.Entry valueEntry : map.get(entryValues.getKey()).entrySet()) { - valueBuilder.appendField(valueEntry.getKey(), valueEntry.getValue()); - allSkipped = false; - } - if (!allSkipped) { - reallyAllSkipped = false; - valuesBuilder.appendField(entryValues.getKey(), valueBuilder.build()); - } - } - if (reallyAllSkipped) { + protected JsonObjectBuilder.JsonObject getChartData() throws Exception { + int value = callable.call(); + if (value == 0) { // Null = skip the chart return null; } - return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build(); + return new JsonObjectBuilder().appendField("value", value).build(); } } diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index bedf1b49..056e6d87 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -2,16 +2,16 @@ #A section symbol will be inserted between each character in this section #http://minecraft.gamepedia.com/Formatting_codes #translated by sumdream -#由 sumdream 翻译 +#由 sumdream 和 10935336 翻译 iconname: 2n icondescription: 5 -info: 2 +info: 6 warn: c menutitle: 8 -#info +#信息 setmode: - msg: 设置为 ,点击盔甲架开始调整. + msg: 设置对象更改为 , 点击盔甲架开始调整。 head: 头部 body: 躯体 leftleg: 左腿 @@ -27,73 +27,106 @@ setmode: baseplate: 底座切换 placement: 位置 rotate: 旋转 - target: 目标 copy: 复制 paste: 粘贴 reset: 重设角度 setaxis: - msg: 设置坐标为 . + msg: 设置坐标为 。 x: X y: Y z: Z setslot: - msg: 设定存档 . + msg: 设定存档槽位 。 setadj: - msg: 设置调整模式 . + msg: 设置调整模式 。 coarse: 粗调 fine: 微调 setgravity: - msg: 重力 . - true: 开启 - false: 关闭 + msg: 重力 。 + on: 开启 + off: 关闭 nomode: msg: 请先点击空气选择设定模式! nomodeif: - msg: Click with the Edit Tool away from the ItemFrame to select a mode first! + msg: 请先点击空气选择设定模式! copied: - msg: 盔甲架装备存档在 . + msg: 盔甲架状态已保存于 。 pasted: - msg: 盔甲架装备复制于 . + msg: 已从 粘贴盔甲架状态。 +target: + msg: 目标盔甲架已锁定。 +notarget: + msg: 目标盔甲架已解锁。 +frametarget: + msg: 目标物品展示框已锁定。 +noframetarget: + msg: 目标物品展示框已解锁。 +doubletarget: + msg: 请看向盔甲架或物品展示框,不要两个同时看! +reloaded: + msg: 配置文件已重新加载。 +help: + msg: "1. 手持编辑工具() + + 2. 对着盔甲架“左键或右键”来打开菜单。 + + 3. 选择标记的菜单选项。 + + 4. 使用编辑工具对着盔甲架“左键”以应用那些选项。 + + 5. 右键单击可反方向编辑!" +helptips: + msg: "小提示: + + 1. 当有别的盔甲架挡着你要编辑的盔甲架时,你可以拿着编辑工具按下“切换副手物品”键 (默认为 F) 来标记你想要编辑的盔甲架。 + + 2. 你可以将“命名牌(NameTags)”用于盔甲架 。更重要的是,你可以使用“&样式代码”标签赋予命名牌更多色彩。 -#warn + 3. 你可以在手持编辑工具时使用“潜行(Shift) + 鼠标滚轮”来快速更改要修改的轴而不需要打开菜单。" +helpurl: + msg: "更多信息: https://github.com/RypoFalem/ArmorStandEditor/wiki" + +#警告 cantedit: - msg: 对不起,你无法在这边编辑盔甲架! + msg: 对不起,你无法在这编辑盔甲架! noperm: - msg: 你没有权限这么做! + msg: 你没有权限这样做! noslotnumcom: - msg: 你必须选择一个畜存栏! + msg: 你必须选择一个物品栏! noadjcom: msg: 你必须选择一个调整模式(粗调/微调)! noaxiscom: msg: 你必须选择一个坐标轴! nomodecom: msg: 你必须选择一个部位! +noreloadcom: + msg: 你没有权限运行重载命令! -#menutitle +#菜单标题 mainmenutitle: msg: 盔甲架编辑器 equiptitle: msg: 盔甲架装备 -#icons +#图标 xaxis: msg: X 轴 description: - msg: 在 X 轴调整位置 + msg: 调整 X 轴位置 yaxis: msg: Y 轴 description: - msg: 在 Y 轴调整位置 + msg: 调整 Y 轴位置 zaxis: msg: Z 轴 description: - msg: 在 Z 轴调整位置 + msg: 调整 Z 轴位置 coarseadj: - msg: 粗调 + msg: 粗略调整 description: msg: 调整幅度较大 fineadj: - msg: 微调 + msg: 精细调整 description: msg: 调整幅度较小 head: @@ -129,21 +162,21 @@ showarms: description: msg: 切换是否显示手臂 invisible: - msg: 显隐 - description: - msg: 是否显示盔甲架 + msg: 盔甲架显隐切换 + description: + msg: 显示/隐形盔甲架 size: msg: 大小 description: msg: 调整大小 disableslots: - msg: 禁用slots + msg: 禁用盔甲槽操作 description: - msg: 开启关闭装备锁定 + msg: 开启或关闭装备锁定 gravity: msg: 重力 description: - msg: 开启关闭重力 + msg: 开启或关闭盔甲架重力 baseplate: msg: 底座 description: @@ -156,10 +189,6 @@ rotate: msg: 旋转 description: msg: 旋转盔甲架位置 -target: - msg: 目标 - description: - msg: 马上实现! copy: msg: 复制 description: @@ -171,19 +200,27 @@ paste: copyslot: msg: 设定存档 description: - msg: 选择存档保存盔甲架设定 + msg: 选择保存盔甲架设定的一个存档位 reset: msg: 重设角度 description: msg: 重设各个部件的角度 - -#icons (equipment) +helpgui: + msg: 我需要帮助! + description: + msg: 点击获得帮助! +itemframevisible: + msg: 物品展示框显隐切换 + description: + msg: 显示/隐形物品展示框 + +#图标 (装备) disabled: msg: 关闭 equipslot: - msg: Slot + msg: 槽 description: - msg: 拖动你的 放置到 + msg: 将你的 放置到下面的格子 helm: 头盔 chest: 胸甲 pants: 护膝 @@ -195,4 +232,4 @@ equipslot: pants: 护膝 boots: 靴子 rhand: 右手 - lhand: 左手 \ No newline at end of file + lhand: 左手 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 558966e9..3b5e7605 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ArmorStandEditor main: io.github.rypofalem.armorstandeditor.ArmorStandEditorPlugin -version: 1.18.1-33.1 +version: 1.18.2-34 api-version: "1.13" website: https://www.spigotmc.org/resources/94503/ author: Wolfstorm