Replace ( and ) by ~ in /ncp version. Just BLOCKSMC1_4, no (base).

Doesn't look better ingame/console, but might on GitHub.
This commit is contained in:
asofold 2016-01-25 21:49:06 +01:00
parent 0a32d55039
commit e278e01a3c
2 changed files with 12 additions and 8 deletions

View File

@ -43,18 +43,18 @@ public class VersionCommand extends BaseCommand{
lines.addAll(Arrays.asList(new String[]{ lines.addAll(Arrays.asList(new String[]{
"---- Version information ----", "---- Version information ----",
"#### Server ####", "#### Server ####",
Bukkit.getServer().getVersion(), alt(Bukkit.getServer().getVersion()),
"(detected: " + ServerVersion.getMinecraftVersion() + ")", " detected: " + alt(ServerVersion.getMinecraftVersion()),
"#### NoCheatPlus ####", "#### NoCheatPlus ####",
"Plugin: " + Bukkit.getPluginManager().getPlugin("NoCheatPlus").getDescription().getVersion(), "Plugin: " + alt(Bukkit.getPluginManager().getPlugin("NoCheatPlus").getDescription().getVersion()),
"MCAccess: " + mcAccess.getMCVersion() + " / " + mcAccess.getServerVersionTag(), "MCAccess: " + alt(mcAccess.getMCVersion() + " / " + mcAccess.getServerVersionTag()),
})); }));
final Map<String, Set<String>> featureTags = NCPAPIProvider.getNoCheatPlusAPI().getAllFeatureTags(); final Map<String, Set<String>> featureTags = NCPAPIProvider.getNoCheatPlusAPI().getAllFeatureTags();
if (!featureTags.isEmpty()) { if (!featureTags.isEmpty()) {
final List<String> features = new LinkedList<String>(); final List<String> features = new LinkedList<String>();
// Add present features. // Add present features.
for (final Entry<String, Set<String>> entry : featureTags.entrySet()) { for (final Entry<String, Set<String>> entry : featureTags.entrySet()) {
features.add(" " + entry.getKey() + ": " + StringUtil.join(entry.getValue(), " | ")); features.add(alt(" " + entry.getKey() + ": " + StringUtil.join(entry.getValue(), " | ")));
} }
// Sort and add. // Sort and add.
Collections.sort(features, String.CASE_INSENSITIVE_ORDER); Collections.sort(features, String.CASE_INSENSITIVE_ORDER);
@ -65,7 +65,7 @@ public class VersionCommand extends BaseCommand{
if (!hooks.isEmpty()){ if (!hooks.isEmpty()){
final List<String> fullNames = new LinkedList<String>(); final List<String> fullNames = new LinkedList<String>();
for (final NCPHook hook : hooks){ for (final NCPHook hook : hooks){
fullNames.add(hook.getHookName() + " " + hook.getHookVersion()); fullNames.add(alt(hook.getHookName() + " " + hook.getHookVersion()));
} }
Collections.sort(fullNames, String.CASE_INSENSITIVE_ORDER); Collections.sort(fullNames, String.CASE_INSENSITIVE_ORDER);
lines.add("Hooks: " + StringUtil.join(fullNames, " | ")); lines.add("Hooks: " + StringUtil.join(fullNames, " | "));
@ -74,7 +74,7 @@ public class VersionCommand extends BaseCommand{
for (final String name : new String[]{"CompatNoCheatPlus", "ProtocolLib"}) { for (final String name : new String[]{"CompatNoCheatPlus", "ProtocolLib"}) {
Plugin plugin = Bukkit.getPluginManager().getPlugin(name); Plugin plugin = Bukkit.getPluginManager().getPlugin(name);
if (plugin != null) { if (plugin != null) {
relatedPlugins.add(plugin.getDescription().getFullName()); relatedPlugins.add(alt(plugin.getDescription().getFullName()));
} }
} }
if (!relatedPlugins.isEmpty()) { if (!relatedPlugins.isEmpty()) {
@ -84,4 +84,8 @@ public class VersionCommand extends BaseCommand{
return lines; return lines;
} }
private static String alt(String x) {
return x.replace('(', '~').replace(')', '~');
}
} }

View File

@ -422,7 +422,7 @@ public class BlockProperties {
try{ try{
initTools(mcAccess, worldConfigProvider); initTools(mcAccess, worldConfigProvider);
initBlocks(mcAccess, worldConfigProvider); initBlocks(mcAccess, worldConfigProvider);
blocksFeatures.add("BlocksMC1_4(base)"); blocksFeatures.add("BlocksMC1_4");
// Extra hand picked setups. // Extra hand picked setups.
try{ try{
blocksFeatures.addAll(new VanillaBlocksFactory().setupVanillaBlocks(worldConfigProvider)); blocksFeatures.addAll(new VanillaBlocksFactory().setupVanillaBlocks(worldConfigProvider));