mirror of
https://github.com/LordBoos/boosCooldowns.git
synced 2024-11-26 12:35:47 +01:00
Added: command aliasses
This commit is contained in:
parent
1a5032d492
commit
011d9fdeec
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user