Added: command aliasses

This commit is contained in:
Boos 2012-08-31 15:50:38 +02:00
parent 1a5032d492
commit 011d9fdeec
3 changed files with 19 additions and 9 deletions

View File

@ -130,6 +130,8 @@ public class boosConfigManager {
"/otherCommand" };
conf.addDefault("commands.links.linkGroups.yourNameHere",
Arrays.asList(def2));
conf.addDefault("commands.aliasses./home", "/warp home");
conf.addDefault("commands.aliasses./spawn", "/mv spawn");
conf.save(confFile);
} catch (IOException e) {
e.printStackTrace();
@ -486,10 +488,14 @@ public class boosConfigManager {
.getConfigurationSection("commands.limits." + lim);
return uses;
}
// public static String getWarmUpCancelledByDeathMessage() {
// return conf.getString(
// "commands.options.message_warmup_cancelled_by_death",
// "&6Warm-ups have been cancelled due to death.&f");
// }
public static ConfigurationSection getAliasses(){
ConfigurationSection aliasses = conf
.getConfigurationSection("commands.aliasses");
return aliasses;
}
public static String getAliass(String message){
return conf.getString("commands.aliasses." + message);
}
}

View File

@ -3,6 +3,7 @@ package cz.boosik.boosCooldown;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -35,7 +36,11 @@ public class boosCoolDownListener<a> implements Listener {
if (event.isCancelled()) {
return;
}
ConfigurationSection aliasses = boosConfigManager.getAliasses();
String message = event.getMessage();
if (aliasses.contains(message)){
message = boosConfigManager.getAliass(message);
}
message = message.trim().replaceAll(" +", " ");
Player player = event.getPlayer();
boolean on = true;

View File

@ -1,8 +1,7 @@
name: boosCooldowns
main: cz.boosik.boosCooldown.boosCoolDown
version: 2.9.4
author: LordBoos
authors: [LordBoos, boosik (ingame name)]
version: 3.0.0
authors: [LordBoos (ingame name boosik)]
softdepend: [Vault,PermissionsEX]
description: >
Shortcuts