MassiveCore - PermUtil --> PermissionUtil
This commit is contained in:
parent
6caa385eb5
commit
f7183d440e
@ -11,7 +11,7 @@ import com.massivecraft.massivecore.command.editor.annotation.EditorType;
|
|||||||
import com.massivecraft.massivecore.command.type.TypeMillisDiff;
|
import com.massivecraft.massivecore.command.type.TypeMillisDiff;
|
||||||
import com.massivecraft.massivecore.store.Entity;
|
import com.massivecraft.massivecore.store.Entity;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import com.massivecraft.massivecore.util.PermUtil;
|
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||||
import com.massivecraft.massivecore.util.TimeUnit;
|
import com.massivecraft.massivecore.util.TimeUnit;
|
||||||
import com.massivecraft.massivecore.xlib.mongodb.WriteConcern;
|
import com.massivecraft.massivecore.xlib.mongodb.WriteConcern;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class MassiveCoreMConf extends Entity<MassiveCoreMConf>
|
|||||||
|
|
||||||
public int getTpdelay(Permissible permissible)
|
public int getTpdelay(Permissible permissible)
|
||||||
{
|
{
|
||||||
Integer ret = PermUtil.pickFirstVal(permissible, permissionToTpdelay);
|
Integer ret = PermissionUtil.pickFirstVal(permissible, permissionToTpdelay);
|
||||||
if (ret == null) ret = 0;
|
if (ret == null) ret = 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package com.massivecraft.massivecore;
|
|||||||
|
|
||||||
import org.bukkit.permissions.Permissible;
|
import org.bukkit.permissions.Permissible;
|
||||||
|
|
||||||
import com.massivecraft.massivecore.util.PermUtil;
|
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||||
|
|
||||||
public enum MassiveCorePerm
|
public enum MassiveCorePerm
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ public enum MassiveCorePerm
|
|||||||
|
|
||||||
public boolean has(Permissible permissible, boolean informSenderIfNot)
|
public boolean has(Permissible permissible, boolean informSenderIfNot)
|
||||||
{
|
{
|
||||||
return PermUtil.has(permissible, this.node, informSenderIfNot);
|
return PermissionUtil.has(permissible, this.node, informSenderIfNot);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(Permissible permissible)
|
public boolean has(Permissible permissible)
|
||||||
|
@ -31,7 +31,7 @@ import com.massivecraft.massivecore.command.type.Type;
|
|||||||
import com.massivecraft.massivecore.mixin.MixinMessage;
|
import com.massivecraft.massivecore.mixin.MixinMessage;
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import com.massivecraft.massivecore.predicate.PredicateStartsWithIgnoreCase;
|
import com.massivecraft.massivecore.predicate.PredicateStartsWithIgnoreCase;
|
||||||
import com.massivecraft.massivecore.util.PermUtil;
|
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
|
||||||
public class MassiveCommand implements Active, PluginIdentifiableCommand
|
public class MassiveCommand implements Active, PluginIdentifiableCommand
|
||||||
@ -739,7 +739,7 @@ public class MassiveCommand implements Active, PluginIdentifiableCommand
|
|||||||
String perm = this.getDescPermission();
|
String perm = this.getDescPermission();
|
||||||
if (perm != null)
|
if (perm != null)
|
||||||
{
|
{
|
||||||
String pdesc = PermUtil.getDescription(perm);
|
String pdesc = PermissionUtil.getDescription(perm);
|
||||||
if (pdesc != null)
|
if (pdesc != null)
|
||||||
{
|
{
|
||||||
return pdesc;
|
return pdesc;
|
||||||
|
@ -3,7 +3,7 @@ package com.massivecraft.massivecore.command.requirement;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||||
import com.massivecraft.massivecore.util.PermUtil;
|
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||||
|
|
||||||
public class RequirementHasPerm extends RequirementAbstract
|
public class RequirementHasPerm extends RequirementAbstract
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ public class RequirementHasPerm extends RequirementAbstract
|
|||||||
@Override
|
@Override
|
||||||
public String createErrorMessage(CommandSender sender, MassiveCommand command)
|
public String createErrorMessage(CommandSender sender, MassiveCommand command)
|
||||||
{
|
{
|
||||||
return PermUtil.getDeniedMessage(this.perm);
|
return PermissionUtil.getDeniedMessage(this.perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import com.massivecraft.massivecore.mixin.MixinPlayed;
|
|||||||
import com.massivecraft.massivecore.mixin.MixinVisibility;
|
import com.massivecraft.massivecore.mixin.MixinVisibility;
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
import com.massivecraft.massivecore.util.PermUtil;
|
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||||
|
|
||||||
public abstract class SenderEntity<E extends SenderEntity<E>> extends Entity<E> implements Named
|
public abstract class SenderEntity<E extends SenderEntity<E>> extends Entity<E> implements Named
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ public abstract class SenderEntity<E extends SenderEntity<E>> extends Entity<E>
|
|||||||
T ret = super.convertGet(value, defaultValue);
|
T ret = super.convertGet(value, defaultValue);
|
||||||
|
|
||||||
// Permission Requirement
|
// Permission Requirement
|
||||||
if ( ! Objects.equal(value, defaultValue) && ! PermUtil.has(this.getSender(), permission)) return defaultValue;
|
if ( ! Objects.equal(value, defaultValue) && ! PermissionUtil.has(this.getSender(), permission)) return defaultValue;
|
||||||
|
|
||||||
// Return
|
// Return
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -13,7 +13,7 @@ import com.massivecraft.massivecore.Lang;
|
|||||||
import com.massivecraft.massivecore.MassiveCore;
|
import com.massivecraft.massivecore.MassiveCore;
|
||||||
import com.massivecraft.massivecore.event.EventMassiveCorePermissionDeniedFormat;
|
import com.massivecraft.massivecore.event.EventMassiveCorePermissionDeniedFormat;
|
||||||
|
|
||||||
public class PermUtil
|
public class PermissionUtil
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// HAS
|
// HAS
|
@ -126,7 +126,7 @@ public class SignUtil
|
|||||||
if ( ! title.equalsIgnoreCase(lenientTitle)) return false;
|
if ( ! title.equalsIgnoreCase(lenientTitle)) return false;
|
||||||
|
|
||||||
// ... verify that the player has permission to create that type of sign ...
|
// ... verify that the player has permission to create that type of sign ...
|
||||||
if ( ! PermUtil.has(player, permissionNode, true))
|
if ( ! PermissionUtil.has(player, permissionNode, true))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user