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" }; "/otherCommand" };
conf.addDefault("commands.links.linkGroups.yourNameHere", conf.addDefault("commands.links.linkGroups.yourNameHere",
Arrays.asList(def2)); Arrays.asList(def2));
conf.addDefault("commands.aliasses./home", "/warp home");
conf.addDefault("commands.aliasses./spawn", "/mv spawn");
conf.save(confFile); conf.save(confFile);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -486,10 +488,14 @@ public class boosConfigManager {
.getConfigurationSection("commands.limits." + lim); .getConfigurationSection("commands.limits." + lim);
return uses; return uses;
} }
// public static String getWarmUpCancelledByDeathMessage() {
// return conf.getString( public static ConfigurationSection getAliasses(){
// "commands.options.message_warmup_cancelled_by_death", ConfigurationSection aliasses = conf
// "&6Warm-ups have been cancelled due to death.&f"); .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 java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -35,7 +36,11 @@ public class boosCoolDownListener<a> implements Listener {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }
ConfigurationSection aliasses = boosConfigManager.getAliasses();
String message = event.getMessage(); String message = event.getMessage();
if (aliasses.contains(message)){
message = boosConfigManager.getAliass(message);
}
message = message.trim().replaceAll(" +", " "); message = message.trim().replaceAll(" +", " ");
Player player = event.getPlayer(); Player player = event.getPlayer();
boolean on = true; boolean on = true;

View File

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