Browse Source

Color redsign and rebranding for EntryRise

master
Stefatorus 3 years ago
parent
commit
af2c3f081e
  1. 2
      src/com/entryrise/lagassist/Data.java
  2. 2
      src/com/entryrise/lagassist/Main.java
  3. 4
      src/com/entryrise/lagassist/MonTools.java
  4. 16
      src/com/entryrise/lagassist/chunks/ChkAnalyse.java
  5. 8
      src/com/entryrise/lagassist/chunks/ChkStats.java
  6. 6
      src/com/entryrise/lagassist/chunks/ChunkGenerator.java
  7. 82
      src/com/entryrise/lagassist/cmd/CommandListener.java
  8. 10
      src/com/entryrise/lagassist/cmd/StatsAnalyse.java
  9. 18
      src/com/entryrise/lagassist/minebench/Approximate.java
  10. 10
      src/com/entryrise/lagassist/minebench/SpeedTest.java
  11. 32
      src/com/entryrise/lagassist/updater/SmartUpdater.java

2
src/com/entryrise/lagassist/Data.java

@ -130,7 +130,7 @@ public class Data {
if (isSellHopper(loc)) { if (isSellHopper(loc)) {
data.set(cloc + ".sellhopper", false); data.set(cloc + ".sellhopper", false);
p.sendMessage(Main.PREFIX + "This sellhopper has been §cdisabled§f at " + percentage + "§f.");
p.sendMessage(Main.PREFIX + "This sellhopper has been §2disabled§f at " + percentage + "§f.");
saveData(); saveData();
return true; return true;
} else { } else {

2
src/com/entryrise/lagassist/Main.java

@ -40,7 +40,7 @@ public class Main extends JavaPlugin implements Listener {
public static String USER = "%%__USER__%%"; public static String USER = "%%__USER__%%";
public static final String PREFIX = c§lLag§f§lAssist §e» §f";
public static final String PREFIX = 2§lLag§f§lAssist §e» §f";
public static JavaPlugin p; public static JavaPlugin p;
public static boolean paper = false; public static boolean paper = false;

4
src/com/entryrise/lagassist/MonTools.java

@ -41,7 +41,7 @@ public class MonTools implements Listener {
} }
Bukkit.getLogger().info(" §e[§a✔§e] §fMapVisualizer."); Bukkit.getLogger().info(" §e[§a✔§e] §fMapVisualizer.");
mapitemmeta.setDisplayName(c§lLag§f§lAssist §e§lMonitor");
mapitemmeta.setDisplayName(2§lLag§f§lAssist §e§lMonitor");
mapitem.setItemMeta(mapitemmeta); mapitem.setItemMeta(mapitemmeta);
int mapid = VersionMgr.getMapId(mapitem); int mapid = VersionMgr.getMapId(mapitem);
@ -91,7 +91,7 @@ public class MonTools implements Listener {
} else if (tpsraw > 15) { } else if (tpsraw > 15) {
tps = "§e" + format.format(tpsraw); tps = "§e" + format.format(tpsraw);
} else { } else {
tps = c" + format.format(tpsraw);
tps = 2" + format.format(tpsraw);
} }
String s = ChatColor.translateAlternateColorCodes('&', String s = ChatColor.translateAlternateColorCodes('&',
stbmsg.replaceAll("\\{TPS\\}", tps) stbmsg.replaceAll("\\{TPS\\}", tps)

16
src/com/entryrise/lagassist/chunks/ChkAnalyse.java

@ -54,7 +54,7 @@ public class ChkAnalyse {
} }
Collections.sort(scores); Collections.sort(scores);
p.sendMessage(""); p.sendMessage("");
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛ §f§lCHUNKANALYSER §c§l⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛ §f§lCHUNKANALYSER §2§l⬛⬛⬛⬛⬛⬛");
p.sendMessage(""); p.sendMessage("");
for (int i = 0; i < ammoshow; i++) { for (int i = 0; i < ammoshow; i++) {
@ -63,7 +63,7 @@ public class ChkAnalyse {
} }
p.sendMessage(""); p.sendMessage("");
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }
}); });
@ -129,16 +129,16 @@ public class ChkAnalyse {
String cmd = "lagassist tpchunk " + p.getWorld().getName() + " " + String.valueOf(coords[0]) + " " String cmd = "lagassist tpchunk " + p.getWorld().getName() + " " + String.valueOf(coords[0]) + " "
+ String.valueOf(coords[1]); + String.valueOf(coords[1]);
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛ §f§lCHUNK STATS §c§l⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛ §f§lCHUNK STATS §2§l⬛⬛⬛⬛⬛⬛");
p.sendMessage(""); p.sendMessage("");
p.sendMessage(" §c✸ §fChunk coordonates: §e" + crds);
p.sendMessage(" §2✸ §fChunk coordonates: §7" + crds);
p.sendMessage(""); p.sendMessage("");
p.sendMessage(" §c✸ §fEntity Amount: §e" + stats.getEnts().length);
p.sendMessage(" §c✸ §fTiles Amount: §e" + stats.getTiles().length);
p.sendMessage(" §2✸ §fEntity Amount: §7" + stats.getEnts().length);
p.sendMessage(" §2✸ §fTiles Amount: §7" + stats.getTiles().length);
p.sendMessage(""); p.sendMessage("");
p.spigot().sendMessage(stats.genMobCount(" §c✸ §fDetailed Info §e(HOVER)", cmd));
p.spigot().sendMessage(stats.genMobCount(" §2✸ §fDetailed Info §7(HOVER)", cmd));
p.sendMessage(""); p.sendMessage("");
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }

8
src/com/entryrise/lagassist/chunks/ChkStats.java

@ -101,11 +101,11 @@ public class ChkStats implements Comparable<ChkStats> {
String regionfile = "r." + String.valueOf(coords[0] >> 5) + "." + String.valueOf(coords[1] >> 5) + ".mca"; String regionfile = "r." + String.valueOf(coords[0] >> 5) + "." + String.valueOf(coords[1] >> 5) + ".mca";
String empt = "\n§c✸ §fClick to teleport!\n\n§fChunk Information:\n §c✸ §fWorld:§e "
+ Chat.capitalize(world.toLowerCase()) + "\n §c✸ §fRegion File:§e " + regionfile
String empt = "\n§2✸ §fClick to teleport!\n\n§fChunk Information:\n §2✸ §fWorld:§e "
+ Chat.capitalize(world.toLowerCase()) + "\n §2✸ §fRegion File:§e " + regionfile
+ "\n\n§fMost often appearances:"; + "\n\n§fMost often appearances:";
for (String stg : tops.keySet()) { for (String stg : tops.keySet()) {
empt = empt + "\n" + " §c✸ §f" + Chat.capitalize(stg.replace('_', ' ')) + ": §e"
empt = empt + "\n" + " §2✸ §f" + Chat.capitalize(stg.replace('_', ' ')) + ": §e"
+ String.valueOf(tops.get(stg)); + String.valueOf(tops.get(stg));
} }
empt = empt + "\n"; empt = empt + "\n";
@ -114,7 +114,7 @@ public class ChkStats implements Comparable<ChkStats> {
} }
public TextComponent genText() { public TextComponent genText() {
String name = " §c✸ §fChunk §c(" + String.valueOf(coords[0]) + " " + String.valueOf(coords[1])
String name = " §2✸ §fChunk §2(" + String.valueOf(coords[0]) + " " + String.valueOf(coords[1])
+ ")§f Score: §e" + String.valueOf(score); + ")§f Score: §e" + String.valueOf(score);
String cmd = "lagassist tpchunk " + world + " " + String.valueOf(coords[0]) + " " + String.valueOf(coords[1]); String cmd = "lagassist tpchunk " + world + " " + String.valueOf(coords[0]) + " " + String.valueOf(coords[1]);
return genMobCount(name, cmd); return genMobCount(name, cmd);

6
src/com/entryrise/lagassist/chunks/ChunkGenerator.java

@ -42,7 +42,7 @@ public class ChunkGenerator {
} }
if (args.length != 2) { if (args.length != 2) {
s.sendMessage(Main.PREFIX + "Correct usage: §c/lagassist pregench [Max-Millis-Per-Tick]");
s.sendMessage(Main.PREFIX + "Correct usage: §2/lagassist pregench [Max-Millis-Per-Tick]");
return; return;
} }
@ -153,7 +153,7 @@ public class ChunkGenerator {
if (i % 300 == 0 && i != 0) { if (i % 300 == 0 && i != 0) {
int percent = (int) ((double) i / chunks.size() * 100); int percent = (int) ((double) i / chunks.size() * 100);
Bukkit.getLogger() Bukkit.getLogger()
.info("§e[§a✪§e] §fThe pregeneration of the §c"
.info("§e[§a✪§e] §fThe pregeneration of the §2"
+ Chat.capitalize(world.getName()) + " §fworld is at §a" + percent + Chat.capitalize(world.getName()) + " §fworld is at §a" + percent
+ "% completion."); + "% completion.");
} }
@ -168,7 +168,7 @@ public class ChunkGenerator {
gentask.cancel(); gentask.cancel();
gentask = null; gentask = null;
Bukkit.getLogger() Bukkit.getLogger()
.info("§e[§a✪§e] §fThe pregeneration of the §c" + Chat.capitalize(world.getName())
.info("§e[§a✪§e] §fThe pregeneration of the §2" + Chat.capitalize(world.getName())
+ " §fworld is finished. Thank you for your patience."); + " §fworld is finished. Thank you for your patience.");
} }

82
src/com/entryrise/lagassist/cmd/CommandListener.java

@ -70,7 +70,7 @@ public class CommandListener implements CommandExecutor {
} else if (arg.equalsIgnoreCase("stopgen") && sender.hasPermission("lagassist.generatechunks")) { } else if (arg.equalsIgnoreCase("stopgen") && sender.hasPermission("lagassist.generatechunks")) {
ChunkGenerator.stopGen(sender); ChunkGenerator.stopGen(sender);
} else if (arg.equalsIgnoreCase("tpchunk")) { } else if (arg.equalsIgnoreCase("tpchunk")) {
sender.sendMessage(Main.PREFIX + "Correct usage: §c/lagassist tpchunk [WORLD] [X] [Z]");
sender.sendMessage(Main.PREFIX + "Correct usage: §2/lagassist tpchunk [WORLD] [X] [Z]");
} else if (arg.equalsIgnoreCase("reload") && sender.hasPermission("lagassist.reload")) { } else if (arg.equalsIgnoreCase("reload") && sender.hasPermission("lagassist.reload")) {
Main.ReloadPlugin(sender); Main.ReloadPlugin(sender);
} else if (arg.equalsIgnoreCase("changelog")) { } else if (arg.equalsIgnoreCase("changelog")) {
@ -80,7 +80,7 @@ public class CommandListener implements CommandExecutor {
UUID p = ((Player) sender).getUniqueId(); UUID p = ((Player) sender).getUniqueId();
if (MonTools.actionmon.contains(p)) { if (MonTools.actionmon.contains(p)) {
MonTools.actionmon.remove(p); MonTools.actionmon.remove(p);
sender.sendMessage(Main.PREFIX + "StatsBar §cDisabled.");
sender.sendMessage(Main.PREFIX + "StatsBar §2Disabled.");
Reflection.sendAction(Bukkit.getPlayer(p), ""); Reflection.sendAction(Bukkit.getPlayer(p), "");
} else { } else {
MonTools.actionmon.add(p); MonTools.actionmon.add(p);
@ -124,7 +124,7 @@ public class CommandListener implements CommandExecutor {
p.teleport(new Location(w, x, y, z)); p.teleport(new Location(w, x, y, z));
p.sendMessage(Main.PREFIX + "You have been teleported to the desired chunk."); p.sendMessage(Main.PREFIX + "You have been teleported to the desired chunk.");
} else { } else {
sender.sendMessage(Main.PREFIX + "Correct usage: §c/lagassist tpchunk [WORLD] [X] [Z]");
sender.sendMessage(Main.PREFIX + "Correct usage: §2/lagassist tpchunk [WORLD] [X] [Z]");
} }
} else { } else {
sender.sendMessage(Main.PREFIX + "You cannot tp to laggy chunks from console."); sender.sendMessage(Main.PREFIX + "You cannot tp to laggy chunks from console.");
@ -145,61 +145,61 @@ public class CommandListener implements CommandExecutor {
if (s instanceof Player) { if (s instanceof Player) {
Player p = (Player) s; Player p = (Player) s;
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist MobCuller §c- §eClear the configured mobs",
"§fClears the mobs that you have set to remove\nin the configuration file.\n\n§c(!) It won't remove named mobs.",
" §2✸ §fLagAssist MobCuller §2- §eClear the configured mobs",
"§fClears the mobs that you have set to remove\nin the configuration file.\n\n§2(!) It won't remove named mobs.",
"LagAssist MobCuller")); "LagAssist MobCuller"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist RedstoneCuller §c- §eDisables Redstone",
" §2✸ §fLagAssist RedstoneCuller §2- §eDisables Redstone",
"§fDisables all the redstone that has been triggered in 30 ticks.\n\nIt can be used to temporarily disable lag-machines\nor to even break them, if you configure it to do so.\nIt also breaks lag-machines that don't use redstone wire!", "§fDisables all the redstone that has been triggered in 30 ticks.\n\nIt can be used to temporarily disable lag-machines\nor to even break them, if you configure it to do so.\nIt also breaks lag-machines that don't use redstone wire!",
"LagAssist RedstoneCuller")); "LagAssist RedstoneCuller"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist ToggleSpawning §c- §eToggles mob spawning",
" §2✸ §fLagAssist ToggleSpawning §2- §eToggles mob spawning",
"§fDisables all mob-spawning once it is toggled on.\n\nIt can be used when many players are online,\nand your server is not keeping up to all the mobs.", "§fDisables all mob-spawning once it is toggled on.\n\nIt can be used when many players are online,\nand your server is not keeping up to all the mobs.",
"LagAssist ToggleSpawning")); "LagAssist ToggleSpawning"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist TogglePhyisics §c- §eToggles physics events.",
" §2✸ §fLagAssist TogglePhyisics §2- §eToggles physics events.",
"§fIt disables all physics events that are enabled\nin the config.\n\nIt can be used to drastically reduce lag on non-minigame servers.", "§fIt disables all physics events that are enabled\nin the config.\n\nIt can be used to drastically reduce lag on non-minigame servers.",
"LagAssist TogglePhysics")); "LagAssist TogglePhysics"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist ChunkAnalyse §c- §eFind the laggiest chunks",
" §2✸ §fLagAssist ChunkAnalyse §2- §eFind the laggiest chunks",
"§fOutput the first X laggiest chunks, based on a score table.\n\nIt can be fully configured, from how many chunks to show to\nhow much score each entity or tile-entity has.", "§fOutput the first X laggiest chunks, based on a score table.\n\nIt can be fully configured, from how many chunks to show to\nhow much score each entity or tile-entity has.",
"LagAssist ChunkAnalyse")); "LagAssist ChunkAnalyse"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist GetMap §c- §eGet a graph of server TPS",
"§fGives you a map that can help find lagspikes.\n§c(!) It exaggerates lag so it is more visible.\n§c(!) do not get alarmed.\n\n§fYou can use it along a cronometer\n§fto find how often the lagspikes happen. Then, you can\nuse your timings report to find a plugin that runs\nTasks at that interval.",
" §2✸ §fLagAssist GetMap §2- §eGet a graph of server TPS",
"§fGives you a map that can help find lagspikes.\n§2(!) It exaggerates lag so it is more visible.\n§2(!) do not get alarmed.\n\n§fYou can use it along a cronometer\n§fto find how often the lagspikes happen. Then, you can\nuse your timings report to find a plugin that runs\nTasks at that interval.",
"LagAssist GetMap")); "LagAssist GetMap"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Benchmark §c- §eGenerates a performance report",
" §2✸ §fLagAssist Benchmark §2- §eGenerates a performance report",
"§fIt can be used to approximate how many players your server\ncan run without lagging, based on collected information.\nIt can also be used to find if hosts are overselling, and how much.", "§fIt can be used to approximate how many players your server\ncan run without lagging, based on collected information.\nIt can also be used to find if hosts are overselling, and how much.",
"LagAssist Benchmark")); "LagAssist Benchmark"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist StatsBar §c- §eGet a simple action-bar TPS Meter",
" §2✸ §fLagAssist StatsBar §2- §eGet a simple action-bar TPS Meter",
"§fShows a simple action-bar showing data that\nis related to lag.\n\nIf you have rare lagspikes, this can help\npinpoint when they happen without having\nto stop doing something else.", "§fShows a simple action-bar showing data that\nis related to lag.\n\nIf you have rare lagspikes, this can help\npinpoint when they happen without having\nto stop doing something else.",
"LagAssist StatsBar")); "LagAssist StatsBar"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist TpChunk §c- §eTeleport to a chunk",
"§f/LagAssist TpChunk [World] [X] [Z].\n\n§c(!) The X and Z variables are not F3 coords.\n\n",
" §2✸ §fLagAssist TpChunk §2- §eTeleport to a chunk",
"§f/LagAssist TpChunk [World] [X] [Z].\n\n§2(!) The X and Z variables are not F3 coords.\n\n",
"LagAssist TpChunk")); "LagAssist TpChunk"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist PreGenCH §c- §ePre-Generate chunks",
"§f/LagAssist PreGenCH [Radius] [Delay] [Amount]\n\n§c(!) This doesn't have any failsafes.\n§c(!) If you don't know how to use it, ask me first.",
" §2✸ §fLagAssist PreGenCH §2- §ePre-Generate chunks",
"§f/LagAssist PreGenCH [Radius] [Delay] [Amount]\n\n§2(!) This doesn't have any failsafes.\n§2(!) If you don't know how to use it, ask me first.",
"LagAssist PreGenCH")); "LagAssist PreGenCH"));
p.spigot() p.spigot()
.sendMessage(Chat.genHoverAndSuggestTextComponent( .sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist ChunkHopper §c- §eGet Chunk Hoppers",
" §2✸ §fLagAssist ChunkHopper §2- §eGet Chunk Hoppers",
"§f/LagAssist chunkhopper [Player] [Amount]\n\n§fTGive a player a chunk hopper.", "§f/LagAssist chunkhopper [Player] [Amount]\n\n§fTGive a player a chunk hopper.",
"LagAssist ChunkHopper")); "LagAssist ChunkHopper"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Changelog §c- §eCheck Version info.",
" §2✸ §fLagAssist Changelog §2- §eCheck Version info.",
"§fThis tool will show you the changelog in an update.\nIt is really useful if you haven't checked the changelog in the updates page already.", "§fThis tool will show you the changelog in an update.\nIt is really useful if you haven't checked the changelog in the updates page already.",
"LagAssist Changelog")); "LagAssist Changelog"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Version §c- §eShows you the plugin version.",
" §2✸ §fLagAssist Version §2- §eShows you the plugin version.",
"§fThis should be used when reporting bugs.\nYou should allways update first when having a bug,\nas I fix bugs quite fast once i find them.", "§fThis should be used when reporting bugs.\nYou should allways update first when having a bug,\nas I fix bugs quite fast once i find them.",
"LagAssist Version")); "LagAssist Version"));
p.spigot().sendMessage( p.spigot().sendMessage(
Chat.genHoverAndSuggestTextComponent(" §c✸ §fLagAssist Reload §c- §eReloads the config",
Chat.genHoverAndSuggestTextComponent(" §2✸ §fLagAssist Reload §2- §eReloads the config",
"§fUse it when you changed the config", "LagAssist Reload")); "§fUse it when you changed the config", "LagAssist Reload"));
} else { } else {
s.sendMessage(" ✸ LagAssist MobCuller - Clear the configured mobs"); s.sendMessage(" ✸ LagAssist MobCuller - Clear the configured mobs");
@ -221,60 +221,60 @@ public class CommandListener implements CommandExecutor {
private static void helpnew(CommandSender p) { private static void helpnew(CommandSender p) {
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist MobCuller §c- §eClear the configured mobs",
"§fClears the mobs that you have set to remove\nin the configuration file.\n\n§c(!) It won't remove named mobs.",
" §2✸ §fLagAssist MobCuller §2- §eClear the configured mobs",
"§fClears the mobs that you have set to remove\nin the configuration file.\n\n§2(!) It won't remove named mobs.",
"LagAssist MobCuller")); "LagAssist MobCuller"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist RedstoneCuller §c- §eDisables Redstone",
" §2✸ §fLagAssist RedstoneCuller §2- §eDisables Redstone",
"§fDisables all the redstone that has been triggered in 30 ticks.\n\nIt can be used to temporarily disable lag-machines\nor to even break them, if you configure it to do so.\nIt also breaks lag-machines that don't use redstone wire!", "§fDisables all the redstone that has been triggered in 30 ticks.\n\nIt can be used to temporarily disable lag-machines\nor to even break them, if you configure it to do so.\nIt also breaks lag-machines that don't use redstone wire!",
"LagAssist RedstoneCuller")); "LagAssist RedstoneCuller"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist ToggleSpawning §c- §eToggles mob spawning",
" §2✸ §fLagAssist ToggleSpawning §2- §eToggles mob spawning",
"§fDisables all mob-spawning once it is toggled on.\n\nIt can be used when many players are online,\nand your server is not keeping up to all the mobs.", "§fDisables all mob-spawning once it is toggled on.\n\nIt can be used when many players are online,\nand your server is not keeping up to all the mobs.",
"LagAssist ToggleSpawning")); "LagAssist ToggleSpawning"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist TogglePhyisics §c- §eToggles physics events.",
" §2✸ §fLagAssist TogglePhyisics §2- §eToggles physics events.",
"§fIt disables all physics events that are enabled\nin the config.\n\nIt can be used to drastically reduce lag on non-minigame servers.", "§fIt disables all physics events that are enabled\nin the config.\n\nIt can be used to drastically reduce lag on non-minigame servers.",
"LagAssist TogglePhysics")); "LagAssist TogglePhysics"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist ChunkAnalyse §c- §eFind the laggiest chunks",
" §2✸ §fLagAssist ChunkAnalyse §2- §eFind the laggiest chunks",
"§fOutput the first X laggiest chunks, based on a score table.\n\nIt can be fully configured, from how many chunks to show to\nhow much score each entity or tile-entity has.", "§fOutput the first X laggiest chunks, based on a score table.\n\nIt can be fully configured, from how many chunks to show to\nhow much score each entity or tile-entity has.",
"LagAssist ChunkAnalyse")); "LagAssist ChunkAnalyse"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist GetMap §c- §eGet a graph of server TPS",
"§fGives you a map that can help find lagspikes.\n§c(!) It exaggerates lag so it is more visible.\n§c(!) do not get alarmed.\n\n§fYou can use it along a cronometer\n§fto find how often the lagspikes happen. Then, you can\nuse your timings report to find a plugin that runs\nTasks at that interval.",
" §2✸ §fLagAssist GetMap §2- §eGet a graph of server TPS",
"§fGives you a map that can help find lagspikes.\n§2(!) It exaggerates lag so it is more visible.\n§2(!) do not get alarmed.\n\n§fYou can use it along a cronometer\n§fto find how often the lagspikes happen. Then, you can\nuse your timings report to find a plugin that runs\nTasks at that interval.",
"LagAssist GetMap")); "LagAssist GetMap"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Benchmark §c- §eGenerates a performance report",
" §2✸ §fLagAssist Benchmark §2- §eGenerates a performance report",
"§fIt can be used to approximate how many players your server\ncan run without lagging, based on collected information.\nIt can also be used to find if hosts are overselling, and how much.", "§fIt can be used to approximate how many players your server\ncan run without lagging, based on collected information.\nIt can also be used to find if hosts are overselling, and how much.",
"LagAssist Benchmark")); "LagAssist Benchmark"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Ping §c- §eShows a ping benchmark",
" §2✸ §fLagAssist Ping §2- §eShows a ping benchmark",
"§fIt can be used to find the best location to host your server\nbased on what the player ping is.\nThe recommended ping value is under 90ms.", "§fIt can be used to find the best location to host your server\nbased on what the player ping is.\nThe recommended ping value is under 90ms.",
"LagAssist Ping")); "LagAssist Ping"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist StatsBar §c- §eGet a simple action-bar TPS Meter",
" §2✸ §fLagAssist StatsBar §2- §eGet a simple action-bar TPS Meter",
"§fShows a simple action-bar showing data that\nis related to lag.\n\nIf you have rare lagspikes, this can help\npinpoint when they happen without having\nto stop doing something else.", "§fShows a simple action-bar showing data that\nis related to lag.\n\nIf you have rare lagspikes, this can help\npinpoint when they happen without having\nto stop doing something else.",
"LagAssist StatsBar")); "LagAssist StatsBar"));
p.spigot() p.spigot()
.sendMessage(Chat.genHoverAndSuggestTextComponent( .sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist TpChunk §c- §eTeleport to a chunk",
"§f/LagAssist TpChunk [World] [X] [Z].\n\n§c(!) The X and Z variables are not F3 coords.\n\n",
" §2✸ §fLagAssist TpChunk §2- §eTeleport to a chunk",
"§f/LagAssist TpChunk [World] [X] [Z].\n\n§2(!) The X and Z variables are not F3 coords.\n\n",
"LagAssist TpChunk")); "LagAssist TpChunk"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist PreGenCH §c- §ePre-Generate chunks",
"§f/LagAssist PreGenCH [Radius] [Delay] [Amount]\n\n§c(!) This doesn't have any failsafes.\n§c(!) If you don't know how to use it, ask me first.",
" §2✸ §fLagAssist PreGenCH §2- §ePre-Generate chunks",
"§f/LagAssist PreGenCH [Radius] [Delay] [Amount]\n\n§2(!) This doesn't have any failsafes.\n§2(!) If you don't know how to use it, ask me first.",
"LagAssist PreGenCH")); "LagAssist PreGenCH"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Changelog §c- §eCheck Version info.",
" §2✸ §fLagAssist Changelog §2- §eCheck Version info.",
"§fThis tool will show you the changelog in an update.\nIt is really useful if you haven't checked the changelog in the updates page already.", "§fThis tool will show you the changelog in an update.\nIt is really useful if you haven't checked the changelog in the updates page already.",
"LagAssist Changelog")); "LagAssist Changelog"));
p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent( p.spigot().sendMessage(Chat.genHoverAndSuggestTextComponent(
" §c✸ §fLagAssist Version §c- §eShows you the plugin version.",
" §2✸ §fLagAssist Version §2- §eShows you the plugin version.",
"§fThis should be used when reporting bugs.\nYou should allways update first when having a bug,\nas I fix bugs quite fast once i find them.", "§fThis should be used when reporting bugs.\nYou should allways update first when having a bug,\nas I fix bugs quite fast once i find them.",
"LagAssist Version")); "LagAssist Version"));
p.spigot().sendMessage( p.spigot().sendMessage(
Chat.genHoverAndSuggestTextComponent(" §c✸ §fLagAssist Reload §c- §eReloads the config",
Chat.genHoverAndSuggestTextComponent(" §2✸ §fLagAssist Reload §2- §eReloads the config",
"§fUse it when you changed the config", "LagAssist Reload")); "§fUse it when you changed the config", "LagAssist Reload"));
} }
@ -283,7 +283,7 @@ public class CommandListener implements CommandExecutor {
boolean oldvers = Bukkit.getVersion().contains("1.8"); boolean oldvers = Bukkit.getVersion().contains("1.8");
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l LAG ASSIST §c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l LAG ASSIST §2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
p.sendMessage(""); p.sendMessage("");
if (oldvers) { if (oldvers) {
help18(p); help18(p);
@ -291,7 +291,7 @@ public class CommandListener implements CommandExecutor {
helpnew(p); helpnew(p);
} }
p.sendMessage(""); p.sendMessage("");
p.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
p.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }
} }

10
src/com/entryrise/lagassist/cmd/StatsAnalyse.java

@ -53,11 +53,11 @@ public class StatsAnalyse implements Listener {
crstg = "NOT AVAILABLE"; crstg = "NOT AVAILABLE";
} }
String stats = "\n\n §c✸ §fExact TPS: §c" + df.format(Monitor.exactTPS) + "\n\n §c✸ §fEntities: §c"
+ String.valueOf(ent) + "\n §c✸ §fLoaded Chunks: §c" + String.valueOf(chk)
+ "\n\n §c✸ §fFree Memory: §c" + String.valueOf(Monitor.freeMEM()) + "MB"
+ "\n §c✸ §fCPU Cores: §c" + crstg + "\n §c✸ §fLoad Average: §c" + loadstg
+ "\n §c✸ §fDisk Space: §c" + String.valueOf((Main.p.getDataFolder().getUsableSpace() / 1073741824))
String stats = "\n\n §2✸ §fExact TPS: §2" + df.format(Monitor.exactTPS) + "\n\n §2✸ §fEntities: §2"
+ String.valueOf(ent) + "\n §2✸ §fLoaded Chunks: §2" + String.valueOf(chk)
+ "\n\n §2✸ §fFree Memory: §2" + String.valueOf(Monitor.freeMEM()) + "MB"
+ "\n §2✸ §fCPU Cores: §2" + crstg + "\n §2✸ §fLoad Average: §2" + loadstg
+ "\n §2✸ §fDisk Space: §2" + String.valueOf((Main.p.getDataFolder().getUsableSpace() / 1073741824))
+ "GB\n"; + "GB\n";
msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(stats).create())); msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(stats).create()));

18
src/com/entryrise/lagassist/minebench/Approximate.java

@ -109,20 +109,20 @@ public class Approximate {
public void run() { public void run() {
for (CommandSender cs : receivers) { for (CommandSender cs : receivers) {
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l BENCHMARK RESULTS §c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
cs.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l BENCHMARK RESULTS §2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(" §c✸ §fCPU Name: §e" + cpuname);
cs.sendMessage(" §2✸ §fCPU Name: §e" + cpuname);
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(" §c✸ §fCPU Score (SINGLE): §e" + br.getStringifiedSth());
cs.sendMessage(" §c✸ §fCPU Score (MULTI): §e" + br.getStringifiedMth());
cs.sendMessage(" §2✸ §fCPU Score (SINGLE): §e" + br.getStringifiedSth());
cs.sendMessage(" §2✸ §fCPU Score (MULTI): §e" + br.getStringifiedMth());
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(" §c✸ §fDownload Speed: §e" + MIBDL + " Mib/s (" + MBDL + "MB/s)");
cs.sendMessage(" §c✸ §fUpload Speed: §e" + MIBUP + " Mib/s (" + MBUP + " MB/s)");
cs.sendMessage(" §2✸ §fDownload Speed: §e" + MIBDL + " Mib/s (" + MBDL + "MB/s)");
cs.sendMessage(" §2✸ §fUpload Speed: §e" + MIBUP + " Mib/s (" + MBUP + " MB/s)");
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(" §c✸ §fMax Players (SINGLE): §e" + singleapprox);
cs.sendMessage(" §c✸ §fMax Players (GLOBAL): §e" + multiapprox);
cs.sendMessage(" §2✸ §fMax Players (SINGLE): §e" + singleapprox);
cs.sendMessage(" §2✸ §fMax Players (GLOBAL): §e" + multiapprox);
cs.sendMessage(""); cs.sendMessage("");
cs.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
cs.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }
receivers.clear(); receivers.clear();
inuse = false; inuse = false;

10
src/com/entryrise/lagassist/minebench/SpeedTest.java

@ -128,14 +128,14 @@ public class SpeedTest {
} }
s.sendMessage(""); s.sendMessage("");
s.sendMessage(c§l⬛⬛⬛⬛⬛⬛§f§l PINGTEST RESULTS §c§l⬛⬛⬛⬛⬛⬛");
s.sendMessage(2§l⬛⬛⬛⬛⬛⬛§f§l PINGTEST RESULTS §2§l⬛⬛⬛⬛⬛⬛");
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fLowest Ping: §e" + String.valueOf(min) + "ms §c(" + namemin + ")");
s.sendMessage(" §c✸ §fHighest Ping: §e" + String.valueOf(max) + "ms §c(" + namemax + ")");
s.sendMessage(" §2✸ §fLowest Ping: §e" + String.valueOf(min) + "ms §2(" + namemin + ")");
s.sendMessage(" §2✸ §fHighest Ping: §e" + String.valueOf(max) + "ms §2(" + namemax + ")");
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fAverage Ping: §e" + df.format((double) (med / nr)) + "ms");
s.sendMessage(" §2✸ §fAverage Ping: §e" + df.format((double) (med / nr)) + "ms");
s.sendMessage(""); s.sendMessage("");
s.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
s.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }
} }

32
src/com/entryrise/lagassist/updater/SmartUpdater.java

@ -38,18 +38,18 @@ public class SmartUpdater {
ui = getNextUpdate(); ui = getNextUpdate();
if (ui == null) { if (ui == null) {
Bukkit.getLogger().info(c§lLag§f§lAssist §e» §fYou are up to date with LagAssist.");
Bukkit.getLogger().info(2§lLag§f§lAssist §e» §fYou are up to date with LagAssist.");
return; return;
} }
Bukkit.getLogger().info(c§lLag§f§lAssist §e» §fWe found a newer LagAssist version:");
Bukkit.getLogger().info(2§lLag§f§lAssist §e» §fWe found a newer LagAssist version:");
if (ui.isUnsafe()) { if (ui.isUnsafe()) {
Bukkit.getLogger().warning(c§lLag§f§lAssist §e» §fThis version is considered Unsafe!");
Bukkit.getLogger().warning(2§lLag§f§lAssist §e» §fThis version is considered Unsafe!");
} }
Bukkit.getLogger().info(" §c[§e֍§c] §fVersion: " + ui.getVersion());
Bukkit.getLogger().info(" §c[§e֍§c] §fReviews: " + ((int) (ui.getRating() * 100)) / 100f + "§e★");
Bukkit.getLogger().info(" §c[§e֍§c] §fDownloads: " + ui.getDownloads());
Bukkit.getLogger().info(" §c[§e֍§c] §fFor more info, use §c/lagassist changelog");
Bukkit.getLogger().info(" §2[§e֍§2] §fVersion: " + ui.getVersion());
Bukkit.getLogger().info(" §2[§e֍§2] §fReviews: " + ((int) (ui.getRating() * 100)) / 100f + "§e★");
Bukkit.getLogger().info(" §2[§e֍§2] §fDownloads: " + ui.getDownloads());
Bukkit.getLogger().info(" §2[§e֍§2] §fFor more info, use §2/lagassist changelog");
} }
}); });
@ -164,27 +164,27 @@ public class SmartUpdater {
public static void showChangelog(CommandSender s) { public static void showChangelog(CommandSender s) {
if (ui == null) { if (ui == null) {
s.sendMessage(c§lLag§f§lAssist §e» §fThere is no new recommended version available.");
s.sendMessage(2§lLag§f§lAssist §e» §fThere is no new recommended version available.");
return; return;
} }
String formatdesc = getFormattedDesc(); String formatdesc = getFormattedDesc();
s.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l LAGASSIST CHANGELOG §c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
s.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛§f§l LAGASSIST CHANGELOG §2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fNew Version: §e" + ui.getVersion());
s.sendMessage(" §2✸ §fNew Version: §e" + ui.getVersion());
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fTitle:");
s.sendMessage(" §2✸ §fTitle:");
s.sendMessage(" §e" + ui.getTitle()); s.sendMessage(" §e" + ui.getTitle());
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fDescription:");
s.sendMessage(" §2✸ §fDescription:");
s.sendMessage(" §e" + formatdesc); s.sendMessage(" §e" + formatdesc);
s.sendMessage(""); s.sendMessage("");
s.sendMessage(" §c✸ §fRating: §e" + ui.getRating() + "★");
s.sendMessage(" §c✸ §fDownloads: §e" + ui.getDownloads());
s.sendMessage(" §c✸ §fLikes: §e" + ui.getLikes());
s.sendMessage(" §2✸ §fRating: §e" + ui.getRating() + "★");
s.sendMessage(" §2✸ §fDownloads: §e" + ui.getDownloads());
s.sendMessage(" §2✸ §fLikes: §e" + ui.getLikes());
s.sendMessage(""); s.sendMessage("");
s.sendMessage(c§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
s.sendMessage(2§l⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛");
} }
} }

Loading…
Cancel
Save