Merge branch 'master' of ZeroHD/QoL into master
commit
2b2c732850
|
@ -10,3 +10,4 @@ Changelogs
|
|||
|
||||
v1.3 <v1.3>
|
||||
v1.4 <v1.4>
|
||||
v1.5 <v1.5>
|
|
@ -0,0 +1,16 @@
|
|||
.. include:: ../common.rst
|
||||
|
||||
.. _qol_v1.5:
|
||||
|
||||
QoL v1.5
|
||||
========
|
||||
|
||||
Additions
|
||||
---------
|
||||
* `Death Mutes Now Toggleable`_ - ``/deathmute`` now toggles death messages on or off for a player
|
||||
|
||||
.. _Death Mutes Now Toggleable: https://git.etztech.xyz/Etzelia/QoL/issues/20
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
None
|
|
@ -39,6 +39,6 @@ Alias ``/names`` and ``/name``
|
|||
|
||||
``/karattrophy <name>`` awards the player the 24 Karat Trophy Advancement.
|
||||
|
||||
``/deathmute <name>`` mutes death messages from a player until a sever restart.
|
||||
``/deathmute <name>`` toggles death messages on or off for a player.
|
||||
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<groupId>xyz.etztech</groupId>
|
||||
<artifactId>QoL</artifactId>
|
||||
<!-- Version is used in plugin.yml -->
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- Plugin Information -->
|
||||
|
|
|
@ -220,9 +220,13 @@ public class QoL extends JavaPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public static void addDeathMute(Player player) {
|
||||
public static boolean toggleDeathMute(Player player) {
|
||||
if (!deathMutes.contains(player.getUniqueId())) {
|
||||
deathMutes.add(player.getUniqueId());
|
||||
return true;
|
||||
} else {
|
||||
deathMutes.remove(player.getUniqueId());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,13 +21,15 @@ public class DeathMuteCommand implements CommandExecutor {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
|
||||
String message;
|
||||
|
||||
if (!commandSender.hasPermission("qol.deathmute")) {
|
||||
EtzTechUtil.sms(commandSender, Lang.NO_PERMISSION.getDef());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
EtzTechUtil.sms(commandSender, ChatColor.RED + "/dm <player>");
|
||||
EtzTechUtil.sms(commandSender, ChatColor.RED + "/deathmute <player>");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -40,10 +42,14 @@ public class DeathMuteCommand implements CommandExecutor {
|
|||
|
||||
final Player player = argPlayer;
|
||||
|
||||
EtzTechUtil.sms(commandSender, ChatColor.GREEN + "Death Muting " + ChatColor.YELLOW +
|
||||
player.getName());
|
||||
if (QoL.toggleDeathMute(player)) {
|
||||
message = ChatColor.GREEN + "Muting death messages from " + ChatColor.YELLOW + player.getName();
|
||||
} else {
|
||||
message = ChatColor.GREEN + "Unmuting death messages from " + ChatColor.YELLOW + player.getName();
|
||||
}
|
||||
|
||||
EtzTechUtil.sms(commandSender, message);
|
||||
|
||||
QoL.addDeathMute(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue