Skip to content

Commit

Permalink
[CORE] ArmorStandEditor 1.19.2-38
Browse files Browse the repository at this point in the history
* [CORE] Fix BStats Language and Add TODOs

Fix TODOs

* [CORE] ArmorStandEditor 1.19.2-38: Prerequisits (#105)

* [CORE] Bump to 1.xx.x-37 (1.xx as I dont know when we will have to update again)

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

* [CI] Bump PlotSquared-Core to v6.9.4 (#112)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CI] Bump PlotSquared-Bukkit to v6.9.4 (#111)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CI] Bump SuperiorSkyblockAPI to v1.11.1 (#109)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CI] Bump towny to v0.98.3.4 (#108)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CORE] Bump Towny to 0.98.3.8 (#115)

* [CORE] Add Lands protection (#116) 

* Add Lands protection and clean up protection system a bit

* Didn't mean to add that

* Add Lands to softdepend

* Bump version

* Bump version

* Add comment

* Add author

* Add another comment

* Add override permission check and add comment

Co-Authored with: PlanetTeamSpeakk <[email protected]>

* [CORE] Add Lands Protection Bypass to permpack

Add in Lands Protection Byspass to the relevant Permpacks - Extension done at the end of #106

* Update dependency com.palmergames.bukkit.towny:towny to v0.98.3.8

Co-authored-by: PlanetTeamSpeak <[email protected]>
Co-authored-by: Larry (Wolfieheart) <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CORE] Remove Discord 

Closing of the community Discord for the time being.

* [CORE] Bump LandsAPI to v6.14.4 (#117)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Larry (Wolfieheart) <[email protected]>

* [CORE] Hotfix - Protections not detecting Plugins Enabled Correctly. Closes #120

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

* [CORE] Bump to 1.19.2-37.2

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

* [CORE] Add in Functionality for Custom Names

* [CORE] Bump to 1.19.2-37.3

* [CORE] Bump to 1.19.2-37.3

* [CORE] Bump PlotSquared to 6.9.4

* [CORE] Optimize Imports

* [CORE] Fix Bugs in Implementation Part 1 - Objests.RequireNonNull

* [CORE] Fix Bug in Checking String Comparison

* [CORE] Fix Build Compliation due to incorrect variable

Signed-off-by: Wolfieheart <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: PlanetTeamSpeak <[email protected]>

* [CORE] Bump Version to 1.19.2-38 (something forgotten)

* [CORE] Build Compilation Fix.

* [CORE] Fix as this is DEV not for Production Use

* [CORE] Bump SuperiorSkyblockAPI to v1.11.1 (#126)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CORE] Clean Up TODOs and add message regarding development builds

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

* [CORE] Fix the idiotic bug of ListSTring Indexes

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

* Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.0 (#128)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency com.bgsoftware:SuperiorSkyblockAPI to v2022 (#129)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Larry (Wolfieheart) <[email protected]>

* Update dependency com.palmergames.bukkit.towny:towny to v0.98.3.10 (#131)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency com.plotsquared:PlotSquared-Bukkit to v6.10.1 (#132)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency com.plotsquared:PlotSquared-Core to v6.10.1 (#133)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* [CORE] Define that that Warning is NAB and shouldnt be reported!

* [CORE] CR Remarks

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

Signed-off-by: Wolfieheart <[email protected]>
Signed-off-by: Wolfieheart <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: PlanetTeamSpeak <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2022
1 parent f023285 commit 1745374
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 58 deletions.
12 changes: 6 additions & 6 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.19.2-37.3</version>
<version>1.19.2-38</version>
<name>armorstandeditor</name>
<url>http://maven.apache.org</url>

Expand Down Expand Up @@ -90,14 +90,14 @@
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared-Core</artifactId>
<version>6.9.4</version>
<version>6.10.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared-Bukkit</artifactId>
<version>6.9.4</version>
<version>6.10.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand All @@ -117,7 +117,7 @@
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<version>0.98.3.8</version>
<version>0.98.3.10</version>
<scope>provided</scope>
</dependency>
<!--- UpdateChecker -->
Expand All @@ -131,7 +131,7 @@
<dependency>
<groupId>com.bgsoftware</groupId>
<artifactId>SuperiorSkyblockAPI</artifactId>
<version>1.11.0</version>
<version>2022.8.1</version>
<scope>provided</scope>
</dependency>
<!--- GriefDefender -->
Expand Down Expand Up @@ -190,7 +190,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,19 @@

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public class ArmorStandEditorPlugin extends JavaPlugin{

public static final int SPIGOT_RESOURCE_ID = 94503; //Used for Update Checker
//!!! DO NOT REMOVE THESE UNDER ANY CIRCUMSTANCES !!!
public static final int SPIGOT_RESOURCE_ID = 94503; //Used for Update Checker
private static final int PLUGIN_ID = 12668; //Used for BStats Metrics

private NamespacedKey iconKey;
private static ArmorStandEditorPlugin instance;
private Language lang;


boolean opUpdateNotification = false;

//Server Version Detection: Paper or Spigot and Invalid NMS Version
String nmsVersion;
public boolean hasSpigot = false;
Expand All @@ -61,23 +59,27 @@ public class ArmorStandEditorPlugin extends JavaPlugin{
static final String SEPARATOR_FIELD = "================================";

public PlayerEditorManager editorManager;


//Output for Updates
boolean opUpdateNotification = false;

//Edit Tool Information
Material editTool;
String toolType;
boolean requireToolData = false;
boolean sendToActionBar = true;

int editToolData = Integer.MIN_VALUE;
boolean requireSneaking = false;
boolean requireToolData = false;
boolean requireToolName = false;
String editToolName = null;
boolean requireToolLore = false;
String editToolLore = null;
boolean allowCustomModelData = false;
Integer customModelDataInt = Integer.MIN_VALUE;


boolean debug = false; //weather or not to broadcast messages via print(String message)

//GUI Settings
boolean requireSneaking = false;
boolean sendToActionBar = true;

//Armor Stand Specific Settings
double coarseRot;
double fineRot;
boolean glowItemFrames = false;
Expand All @@ -89,15 +91,14 @@ public class ArmorStandEditorPlugin extends JavaPlugin{
public Team team;
String lockedTeam = "ASLocked";

//Better Debug Output
private static ArmorStandEditorPlugin plugin;

public ArmorStandEditorPlugin(){
instance = this;
}

@Override
public void onEnable(){
public void onEnable() {

scoreboard = Objects.requireNonNull(this.getServer().getScoreboardManager()).getMainScoreboard();

Expand All @@ -108,21 +109,6 @@ public void onEnable(){
getLogger().info("======= ArmorStandEditor =======");
getLogger().info("Plugin Version: " + pdfFile.getVersion());

//Spigot Check
hasSpigot = getHasSpigot();
getLogger().info("SpigotMC: " + hasSpigot);

//Paper Check
hasPaper = getHasPaper();
getLogger().info("PaperMC: " + hasPaper);

//If Paper and Spigot are both FALSE - Disable the plugin
if (!hasPaper && !hasSpigot){
getLogger().severe("This plugin requires either Paper, Spigot or one of its forks to run");
getServer().getPluginManager().disablePlugin(this);
return;
}

//Minimum Version Check - No Lower than 1.13-API. Will be tuned out in the future
if ( nmsVersion.startsWith("v1_8") ||
nmsVersion.startsWith("v1_9") ||
Expand All @@ -147,6 +133,23 @@ public void onEnable(){
} else {
getLogger().info("Minecraft Version: " + nmsVersion + " is supported. Loading continuing.");
}
//Spigot Check
hasSpigot = getHasSpigot();
hasPaper = getHasPaper();

//If Paper and Spigot are both FALSE - Disable the plugin
if (!hasPaper && !hasSpigot){
getLogger().severe("This plugin requires either Paper, Spigot or one of its forks to run");
getServer().getPluginManager().disablePlugin(this);
getLogger().info(SEPARATOR_FIELD);
return;
} else {
if (hasSpigot) {
getLogger().info("SpigotMC: " + hasSpigot);
} else {
getLogger().info("PaperMC: " + hasPaper);
}
}

getServer().getPluginManager().enablePlugin(this);
registerScoreboards(scoreboard);
Expand All @@ -164,6 +167,7 @@ public void onEnable(){
updateConfig("lang/", "de_DE.yml");
updateConfig("lang/", "es_ES.yml");
updateConfig("lang/", "pt_BR.yml");

//English is the default language and needs to be unaltered to so that there is always a backup message string
saveResource("lang/en_US.yml", true);
lang = new Language(getConfig().getString("lang"), this);
Expand All @@ -182,6 +186,13 @@ public void onEnable(){
getServer().getPluginManager().disablePlugin(this);
return;
}

//Do we require a custom tool name?
requireToolName = getConfig().getBoolean("requireToolName", false);
if(requireToolName){
editToolName = getConfig().getString("toolName", null);
if(editToolName != null) editToolName = ChatColor.translateAlternateColorCodes('&', editToolName);
}

//Custom Model Data
allowCustomModelData = getConfig().getBoolean("allowCustomModelData", false);
Expand All @@ -193,13 +204,6 @@ public void onEnable(){
//ArmorStandVisibility Node
armorStandVisibility = getConfig().getBoolean("armorStandVisibility", true);

//Do we require a custom tool name?
requireToolName = getConfig().getBoolean("requireToolName", false);
if(requireToolName){
editToolName = getConfig().getString("toolName", null);
if(editToolName != null) editToolName = ChatColor.translateAlternateColorCodes('&', editToolName);
}

//Is there NBT Required for the tool
requireToolData = getConfig().getBoolean("requireToolData", false);

Expand All @@ -222,7 +226,6 @@ public void onEnable(){

//All ItemFrame Stuff
glowItemFrames = getConfig().getBoolean("glowingItemFrame", true);

invisibleItemFrames = getConfig().getBoolean("invisibleItemFrames", true);

//Add Ability to check for UpdatePerms that Notify Ops - https://github.com/Wolfieheart/ArmorStandEditor/issues/86
Expand All @@ -248,8 +251,10 @@ public void onEnable(){

private void runUpdateCheckerConsoleUpdateCheck() {
if (Objects.requireNonNull(getConfig().getString("version")).contains(".x")) {
//noinspection UnnecessaryReturnStatement
return;
getLogger().warning("It appears that you are using the development version of ArmorStandEditor");
getLogger().warning("This version can be unstable and is not recommended for Production Environments.");
getLogger().warning("Please, report bugs to: https://github.com/Wolfieheart/ArmorStandEditor . This warning");
getLogger().warning("is intended to be displayed when using a Dev build and is NOT A BUG!");
} else {
new UpdateChecker(this, UpdateCheckSource.SPIGET, "" + SPIGOT_RESOURCE_ID + "")
.setDownloadLink("https://www.spigotmc.org/resources/armorstandeditor-reborn.94503/")
Expand All @@ -261,10 +266,12 @@ private void runUpdateCheckerConsoleUpdateCheck() {
}
}

private void runUpdateCheckerWithOPNotifyOnJoinEnabled() { //We Can Not Dynamically change the setting for NotifyOpsOnJoin :(
private void runUpdateCheckerWithOPNotifyOnJoinEnabled() {
if (Objects.requireNonNull(getConfig().getString("version")).contains(".x")) {
//noinspection UnnecessaryReturnStatement
return;
getLogger().warning("It appears that you are using the development version of ArmorStandEditor");
getLogger().warning("This version can be unstable and is not recommended for Production Environments.");
getLogger().warning("Please, report bugs to: https://github.com/Wolfieheart/ArmorStandEditor . This warning");
getLogger().warning("is intended to be displayed when using a Dev build and is NOT A BUG!");
} else {
new UpdateChecker(this, UpdateCheckSource.SPIGET, "" + SPIGOT_RESOURCE_ID + "")
.setDownloadLink("https://www.spigotmc.org/resources/armorstandeditor-reborn.94503/")
Expand Down Expand Up @@ -395,26 +402,23 @@ public boolean isEditTool(ItemStack itemStk){
if(!itemStk.hasItemMeta()) { return false; }

//Get the lore of the Item and if it is null - Return False
List<String> itemLore = Objects.requireNonNull(itemStk.getItemMeta()).getLore();
String itemLore = String.valueOf(Objects.requireNonNull(itemStk.getItemMeta()).getLore());

//If the Item does not have Lore - Return False
boolean hasTheItemLore = itemStk.getItemMeta().hasLore();
if (!hasTheItemLore) { return false; }

//Item the first thing in the ItemLore List does not Equal the Config Value "editToolLore" - return false
if (!itemLore.get(0).equals(editToolLore)) { return false; } //Does not need simplified - IntelliJ likes to complain here
if (!itemLore.equals(editToolLore)) { return false; } //Does not need simplified - IntelliJ likes to complain here

}

if (allowCustomModelData && customModelDataInt != null) {
//If the ItemStack does not have Metadata then we return false
if(!itemStk.hasItemMeta()) { return false; }

Integer itemCustomModel = Objects.requireNonNull(itemStk.getItemMeta()).getCustomModelData();

return itemCustomModel.equals(customModelDataInt);
}

return true;
}

Expand Down Expand Up @@ -445,8 +449,6 @@ private void getMetrics(){
Map<String, Integer> entry = new HashMap<>();

String languageUsed = getConfig().getString("lang");
entry.put(languageUsed, 1);

assert languageUsed != null;

if (languageUsed.startsWith("nl")) {
Expand Down Expand Up @@ -485,8 +487,8 @@ private void getMetrics(){
//ArmorStandInvis Config
metrics.addCustomChart(new SimplePie("itemframe_invisibility_used", () -> getConfig().getString("invisibleItemFrames")));

//TODO: Add tracking to see who is using Custom Naming in BStats - AKA Remove this soon TM
//metrics.addCustomChart(new SimplePie("custom_toolname_enabled", () -> getConfig().getString("requireToolName")));
//Add tracking to see who is using Custom Naming in BStats
metrics.addCustomChart(new SimplePie("custom_toolname_enabled", () -> getConfig().getString("requireToolName")));


}
Expand Down

0 comments on commit 1745374

Please sign in to comment.