Changed User-Agent in UpdateChecker

This commit is contained in:
mfnalex 2020-05-24 00:34:03 +02:00
parent 3c4a13a7ec
commit c14e5d3e5a
4 changed files with 21 additions and 2 deletions

View File

@ -104,6 +104,13 @@
<version>0.98.9</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/CrackShot.jar</systemPath>
</dependency>
<dependency>
<groupId>com.jojodmo.customitems</groupId>
<artifactId>CustomItems</artifactId>
<version>LATEST</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/CustomItemsAPI_PLACEHOLDER.jar</systemPath>
</dependency>
<dependency>
<groupId>at.pcgamingfreaks</groupId>

View File

@ -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()));

View File

@ -0,0 +1,13 @@
package de.jeffclan.hooks;
import org.bukkit.inventory.ItemStack;
public class CustomItemsHook {
public boolean isCustomItem(ItemStack item) {
return false;
}
}

View File

@ -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;
}
}