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