Skip to content

Commit

Permalink
[CORE] ArmorStandEditor v1.18.2-34 (#38)
Browse files Browse the repository at this point in the history
* [CORE] Bump Version to 1.18.2-34

Signed-off-by: Wolfieheart <[email protected]>
Signed-off-by: Wolfstorm <[email protected]>

* Update zh_CN.yml (#33)

[LANG] Update Simplified Chinese Translation (#33)

* Update actions/checkout action to v3 (#34)

[CI] Update actions/checkout action to v3 (#34)

* Update actions/upload-artifact action to v3 (#36)

[CI] Update actions/upload-artifact action to v3 (#36)

* [CORE] Update Metrics

Signed-off-by: Wolfieheart <[email protected]>
Signed-off-by: Wolfstorm <[email protected]>

Co-authored-by: 10935336 <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 6, 2022
1 parent 0eadfa8 commit 9f2c3f4
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 122 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 8 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.github.rypofalem.armorstandeditor</groupId>
<artifactId>armorstandeditor</artifactId>
<packaging>jar</packaging>
<version>1.18.1-33.1</version>
<version>1.18.2-34</version>
<name>armorstandeditor</name>
<url>http://maven.apache.org</url>

Expand All @@ -24,14 +24,15 @@
</pluginRepositories>

<repositories>
<!-- Spigot MC -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- Towny -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<id>glaremasters repo</id>
<url>https://repo.glaremasters.me/repository/towny/</url>
</repository>
<!--- Update Checker -->
<repository>
Expand All @@ -45,14 +46,14 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!--- Towny -->
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>Towny</artifactId>
<version>0.97.5.1</version>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<version>0.98.0.0</version>
<scope>provided</scope>
</dependency>
<!--- UpdateChecker -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -360,47 +375,51 @@ private static byte[] compress(final String str) throws IOException {
}
}

public static class AdvancedBarChart extends CustomChart {
public static class DrilldownPie extends CustomChart {

private final Callable<Map<String, int[]>> callable;
private final Callable<Map<String, Map<String, Integer>>> callable;

/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
super(chartId);
this.callable = callable;
}

@Override
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
public JsonObjectBuilder.JsonObject getChartData() throws Exception {
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
Map<String, int[]> map = callable.call();
Map<String, Map<String, Integer>> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, int[]> entry : map.entrySet()) {
if (entry.getValue().length == 0) {
// Skip this invalid
continue;
boolean reallyAllSkipped = true;
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
JsonObjectBuilder valueBuilder = new JsonObjectBuilder();
boolean allSkipped = true;
for (Map.Entry<String, Integer> 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;
}
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
}
}

public static class SimpleBarChart extends CustomChart {
public static class AdvancedPie extends CustomChart {

private final Callable<Map<String, Integer>> callable;

Expand All @@ -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<Map<String, Integer>> callable) {
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
super(chartId);
this.callable = callable;
}
Expand All @@ -423,8 +442,18 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, Integer> 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();
}
Expand Down Expand Up @@ -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<Map<String, Integer>> callable;

Expand All @@ -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<Map<String, Integer>> callable) {
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
super(chartId);
this.callable = callable;
}
Expand All @@ -493,18 +522,8 @@ protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, Integer> 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();
}
Expand Down Expand Up @@ -544,99 +563,95 @@ 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<Integer> callable;
private final Callable<String> callable;

/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public SingleLineChart(String chartId, Callable<Integer> callable) {
public SimplePie(String chartId, Callable<String> 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;
}
return new JsonObjectBuilder().appendField("value", value).build();
}
}

public static class SimplePie extends CustomChart {
public static class AdvancedBarChart extends CustomChart {

private final Callable<String> callable;
private final Callable<Map<String, int[]>> callable;

/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public SimplePie(String chartId, Callable<String> callable) {
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> 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<String, int[]> 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<String, int[]> 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<Map<String, Map<String, Integer>>> callable;
private final Callable<Integer> callable;

/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
public SingleLineChart(String chartId, Callable<Integer> callable) {
super(chartId);
this.callable = callable;
}

@Override
public JsonObjectBuilder.JsonObject getChartData() throws Exception {
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
Map<String, Map<String, Integer>> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean reallyAllSkipped = true;
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
JsonObjectBuilder valueBuilder = new JsonObjectBuilder();
boolean allSkipped = true;
for (Map.Entry<String, Integer> 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();
}
}

Expand Down
Loading

0 comments on commit 9f2c3f4

Please sign in to comment.