mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-12-29 04:18:08 +01:00
Group Prefix & Suffix
This commit is contained in:
parent
1b810dda8a
commit
bfe8259216
@ -836,4 +836,72 @@ public abstract class Permission {
|
|||||||
public void setPlayerSuffix(Player player, String suffix) {
|
public void setPlayerSuffix(Player player, String suffix) {
|
||||||
setPlayerSuffix(player.getWorld().getName(), player.getName(), suffix);
|
setPlayerSuffix(player.getWorld().getName(), player.getName(), suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get group prefix
|
||||||
|
* @param world World name
|
||||||
|
* @param group Group name
|
||||||
|
* @return Prefix
|
||||||
|
*/
|
||||||
|
abstract public String getGroupPrefix(String world, String group);
|
||||||
|
/**
|
||||||
|
* Get group prefix
|
||||||
|
* @param world World Object
|
||||||
|
* @param group Group name
|
||||||
|
* @return Prefix
|
||||||
|
*/
|
||||||
|
public String getGroupPrefix(World world, String group) {
|
||||||
|
return getGroupPrefix(world.getName(), group);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set group prefix
|
||||||
|
* @param world World name
|
||||||
|
* @param group Group name
|
||||||
|
* @param prefix Prefix
|
||||||
|
*/
|
||||||
|
abstract public void setGroupPrefix(String world, String group, String prefix);
|
||||||
|
/**
|
||||||
|
* Set group prefix
|
||||||
|
* @param world World Object
|
||||||
|
* @param group Group name
|
||||||
|
* @param prefix Prefix
|
||||||
|
*/
|
||||||
|
public void setGroupPrefix(World world, String group, String prefix) {
|
||||||
|
setGroupPrefix(world.getName(), group, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get group suffix
|
||||||
|
* @param world World name
|
||||||
|
* @param group Group name
|
||||||
|
* @return Suffix
|
||||||
|
*/
|
||||||
|
abstract public String getGroupSuffix(String world, String group);
|
||||||
|
/**
|
||||||
|
* Get group suffix
|
||||||
|
* @param world World Object
|
||||||
|
* @param group Group name
|
||||||
|
* @return Suffix
|
||||||
|
*/
|
||||||
|
public String getGroupSuffix(World world, String group) {
|
||||||
|
return getGroupSuffix(world.getName(), group);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set group suffix
|
||||||
|
* @param world World name
|
||||||
|
* @param group Group name
|
||||||
|
* @param suffix Suffix
|
||||||
|
*/
|
||||||
|
abstract public void setGroupSuffix(String world, String group, String suffix);
|
||||||
|
/**
|
||||||
|
* Set group suffix
|
||||||
|
* @param world World Object
|
||||||
|
* @param group Group name
|
||||||
|
* @param suffix Suffix
|
||||||
|
*/
|
||||||
|
public void setGroupSuffix(World world, String group, String suffix) {
|
||||||
|
setGroupSuffix(world.getName(), group, suffix);
|
||||||
|
}
|
||||||
}
|
}
|
@ -251,4 +251,24 @@ public class Permission_GroupManager extends Permission {
|
|||||||
public void setPlayerPrefix(String world, String player, String prefix) {
|
public void setPlayerPrefix(String world, String player, String prefix) {
|
||||||
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupPrefix(String world, String group) {
|
||||||
|
return perms.getGroupPrefix(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupPrefix(String world, String group, String prefix) {
|
||||||
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupSuffix(String world, String group) {
|
||||||
|
return perms.getGroupSuffix(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupSuffix(String world, String group, String suffix) {
|
||||||
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,4 +261,24 @@ public class Permission_Permissions2 extends Permission {
|
|||||||
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupPrefix(String world, String group) {
|
||||||
|
return perms.getGroupPrefix(world, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupPrefix(String world, String group, String prefix) {
|
||||||
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupSuffix(String world, String group) {
|
||||||
|
return perms.getGroupSuffix(world, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupSuffix(String world, String group, String suffix) {
|
||||||
|
throw new UnsupportedOperationException(getName() + " cannot modify permissions.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -292,4 +292,24 @@ public class Permission_Permissions3 extends Permission {
|
|||||||
public void setPlayerPrefix(String world, String player, String prefix) {
|
public void setPlayerPrefix(String world, String player, String prefix) {
|
||||||
this.perms.addUserInfo(world, player, "prefix", prefix);
|
this.perms.addUserInfo(world, player, "prefix", prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupPrefix(String world, String group) {
|
||||||
|
return perms.getGroupPrefix(world, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupPrefix(String world, String group, String prefix) {
|
||||||
|
this.perms.addGroupInfo(world, group, "prefix", prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupSuffix(String world, String group) {
|
||||||
|
return perms.getGroupSuffix(world, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupSuffix(String world, String group, String suffix) {
|
||||||
|
this.perms.addGroupInfo(world, group, "suffix", suffix);
|
||||||
|
}
|
||||||
}
|
}
|
@ -405,4 +405,41 @@ public class Permission_PermissionsEx extends Permission {
|
|||||||
user.setPrefix(prefix);
|
user.setPrefix(prefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupPrefix(String world, String group) {
|
||||||
|
PermissionGroup pGroup = PermissionsEx.getPermissionManager().getGroup(group);
|
||||||
|
if(group != null) {
|
||||||
|
return pGroup.getPrefix();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupPrefix(String world, String group, String prefix) {
|
||||||
|
PermissionGroup pGroup = PermissionsEx.getPermissionManager().getGroup(group);
|
||||||
|
if(group != null) {
|
||||||
|
pGroup.setPrefix(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupSuffix(String world, String group) {
|
||||||
|
PermissionGroup pGroup = PermissionsEx.getPermissionManager().getGroup(group);
|
||||||
|
if(group != null) {
|
||||||
|
return pGroup.getSuffix();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setGroupSuffix(String world, String group, String suffix) {
|
||||||
|
PermissionGroup pGroup = PermissionsEx.getPermissionManager().getGroup(group);
|
||||||
|
if(group != null) {
|
||||||
|
pGroup.setSuffix(suffix);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user