mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-15 21:39:21 +00:00
Added two new permission nodes - groupmanager.notify.self &
groupmanager.notify.other These allow players/admins to be notified when players are moved between groups.
This commit is contained in:
parent
5395b6f73a
commit
1bb3eb0d07
4 changed files with 34 additions and 1 deletions
|
@ -38,3 +38,5 @@ v 1.3:
|
||||||
(GM will create the data files for any worlds it finds which are not in the config.yml)
|
(GM will create the data files for any worlds it finds which are not in the config.yml)
|
||||||
- Fix for Bukkit passing a null To location on a player Portaling
|
- Fix for Bukkit passing a null To location on a player Portaling
|
||||||
- Fixed manudelsub not correctly selecting the group to remove.
|
- Fixed manudelsub not correctly selecting the group to remove.
|
||||||
|
- Added two new permission nodes - groupmanager.notify.self & groupmanager.notify.other
|
||||||
|
These allow players/admins to be notified when players are moved between groups.
|
|
@ -8,6 +8,7 @@ groups:
|
||||||
- essentials.motd
|
- essentials.motd
|
||||||
- essentials.rules
|
- essentials.rules
|
||||||
- essentials.spawn
|
- essentials.spawn
|
||||||
|
- groupmanager.notify.self
|
||||||
inheritance: []
|
inheritance: []
|
||||||
info:
|
info:
|
||||||
prefix: '&e'
|
prefix: '&e'
|
||||||
|
@ -119,6 +120,7 @@ groups:
|
||||||
- groupmanager.manuadd
|
- groupmanager.manuadd
|
||||||
- groupmanager.manudel
|
- groupmanager.manudel
|
||||||
- groupmanager.manwhois
|
- groupmanager.manwhois
|
||||||
|
- groupmanager.notify.other
|
||||||
inheritance:
|
inheritance:
|
||||||
- builder
|
- builder
|
||||||
info:
|
info:
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.anjocaido.groupmanager.events.GMWorldListener;
|
||||||
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
|
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
|
||||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||||
import org.anjocaido.groupmanager.utils.Tasks;
|
import org.anjocaido.groupmanager.utils.Tasks;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
@ -1751,6 +1752,31 @@ public class GroupManager extends JavaPlugin {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send confirmation of a group change.
|
||||||
|
* using permission nodes...
|
||||||
|
*
|
||||||
|
* groupmanager.notify.self
|
||||||
|
* groupmanager.notify.other
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void notify(String name, String msg) {
|
||||||
|
|
||||||
|
Player player = Bukkit.getServer().getPlayerExact(name);
|
||||||
|
|
||||||
|
for(Player test: Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
if (!test.equals(player)){
|
||||||
|
if (test.hasPermission("groupmanager.notify.other"))
|
||||||
|
test.sendMessage(ChatColor.YELLOW + name +" was " + msg);
|
||||||
|
} else
|
||||||
|
if ((player != null) && ((player.hasPermission("groupmanager.notify.self")) || (player.hasPermission("groupmanager.notify.other"))))
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "You we're " + msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the config
|
* @return the config
|
||||||
|
|
|
@ -119,9 +119,12 @@ public class User extends DataUnit implements Cloneable {
|
||||||
group = getDataSource().getGroup(group.getName());
|
group = getDataSource().getGroup(group.getName());
|
||||||
this.group = group.getName();
|
this.group = group.getName();
|
||||||
flagAsChanged();
|
flagAsChanged();
|
||||||
if (GroupManager.isLoaded())
|
if (GroupManager.isLoaded()) {
|
||||||
if (GroupManager.BukkitPermissions.player_join = false)
|
if (GroupManager.BukkitPermissions.player_join = false)
|
||||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||||
|
|
||||||
|
GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSubGroup(Group subGroup) {
|
public void addSubGroup(Group subGroup) {
|
||||||
|
|
Loading…
Reference in a new issue