mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-26 03:55:40 +01:00
Fix exception on required permission
This commit is contained in:
parent
33bf169adf
commit
10f62a1cfb
@ -52,15 +52,24 @@ public class InternalConfigurableIcon extends BaseConfigurableIcon implements Re
|
||||
}
|
||||
|
||||
public void setClickPermission(String permission) {
|
||||
this.clickPermission = new RequiredPermission(permission);
|
||||
if (this.clickPermission == null) {
|
||||
this.clickPermission = new RequiredPermission();
|
||||
}
|
||||
this.clickPermission.setPermission(permission);
|
||||
}
|
||||
|
||||
public void setNoClickPermissionMessage(String clickNoPermissionMessage) {
|
||||
clickPermission.setNoPermissionMessage(clickNoPermissionMessage);
|
||||
if (this.clickPermission == null) {
|
||||
this.clickPermission = new RequiredPermission();
|
||||
}
|
||||
this.clickPermission.setNoPermissionMessage(clickNoPermissionMessage);
|
||||
}
|
||||
|
||||
public void setViewPermission(String viewPermission) {
|
||||
this.viewPermission = new RequiredPermission(viewPermission);
|
||||
if (this.viewPermission == null) {
|
||||
this.viewPermission = new RequiredPermission();
|
||||
}
|
||||
this.viewPermission.setPermission(viewPermission);
|
||||
}
|
||||
|
||||
public void setRequiredMoney(double requiredMoney) {
|
||||
|
@ -11,11 +11,11 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class RequiredPermission implements Requirement {
|
||||
|
||||
private final String permission;
|
||||
private final boolean negated;
|
||||
private String permission;
|
||||
private boolean negated;
|
||||
private String noPermissionMessage;
|
||||
|
||||
public RequiredPermission(String permission) {
|
||||
|
||||
public void setPermission(String permission) {
|
||||
if (permission != null) {
|
||||
permission = permission.trim();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user