From c14e5d3e5a4cbbaf03539743614049d4eb8bebef Mon Sep 17 00:00:00 2001
From: mfnalex <1122571+mfnalex@users.noreply.github.com>
Date: Sun, 24 May 2020 00:34:03 +0200
Subject: [PATCH] Changed User-Agent in UpdateChecker
---
pom.xml | 7 +++++++
.../JeffChestSort/JeffChestSortUpdateChecker.java | 2 +-
.../java/de/jeffclan/hooks/CustomItemsHook.java | 13 +++++++++++++
src/main/java/de/jeffclan/hooks/MinepacksHook.java | 1 -
4 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 src/main/java/de/jeffclan/hooks/CustomItemsHook.java
diff --git a/pom.xml b/pom.xml
index c3bf7c5..a015a22 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,13 @@
0.98.9
system
${project.basedir}/lib/CrackShot.jar
+
+
+ com.jojodmo.customitems
+ CustomItems
+ LATEST
+ system
+ ${project.basedir}/lib/CustomItemsAPI_PLACEHOLDER.jar
at.pcgamingfreaks
diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortUpdateChecker.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortUpdateChecker.java
index aa60c98..3c3b45c 100644
--- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortUpdateChecker.java
+++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortUpdateChecker.java
@@ -91,7 +91,7 @@ public class JeffChestSortUpdateChecker {
plugin.getLogger().info("Checking for available updates...");
try {
- String userAgent = "ChestSort/"+plugin.getDescription().getVersion()+" (MC "+plugin.mcVersion+")";
+ String userAgent = "ChestSort/"+plugin.getDescription().getVersion()+" (MC "+plugin.mcVersion+", "+plugin.getServer().getOnlinePlayers().size()+"/"+plugin.getServer().getOfflinePlayers().length+")";
HttpURLConnection httpcon = (HttpURLConnection) new URL(latestVersionLink).openConnection();
httpcon.addRequestProperty("User-Agent", userAgent);
BufferedReader reader = new BufferedReader(new InputStreamReader(httpcon.getInputStream()));
diff --git a/src/main/java/de/jeffclan/hooks/CustomItemsHook.java b/src/main/java/de/jeffclan/hooks/CustomItemsHook.java
new file mode 100644
index 0000000..a7023bc
--- /dev/null
+++ b/src/main/java/de/jeffclan/hooks/CustomItemsHook.java
@@ -0,0 +1,13 @@
+package de.jeffclan.hooks;
+
+import org.bukkit.inventory.ItemStack;
+
+public class CustomItemsHook {
+
+ public boolean isCustomItem(ItemStack item) {
+
+
+ return false;
+ }
+
+}
diff --git a/src/main/java/de/jeffclan/hooks/MinepacksHook.java b/src/main/java/de/jeffclan/hooks/MinepacksHook.java
index 4c31a32..08bc9a3 100644
--- a/src/main/java/de/jeffclan/hooks/MinepacksHook.java
+++ b/src/main/java/de/jeffclan/hooks/MinepacksHook.java
@@ -16,7 +16,6 @@ public class MinepacksHook {
this.plugin = plugin;
Plugin bukkitPlugin = Bukkit.getPluginManager().getPlugin("Minepacks");
if(plugin.hookMinepacks && bukkitPlugin instanceof MinepacksPlugin) {
- // Do something if Minepacks is not available
minepacks = (MinepacksPlugin) bukkitPlugin;
}
}