Class PrefixConfig
- java.lang.Object
-
- cc.carm.plugin.userprefix.conf.prefix.PrefixConfig
-
public class PrefixConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull List<GUIActionConfiguration>
actions
protected @NotNull String
content
protected @NotNull String
identifier
protected @NotNull ItemStack
itemHasPermission
protected @Nullable ItemStack
itemNoPermission
protected @Nullable ItemStack
itemWhenUsing
protected @NotNull String
name
protected @Nullable String
permission
protected int
weight
-
Constructor Summary
Constructors Constructor Description PrefixConfig(@NotNull String identifier, @NotNull String name, @NotNull String content, int weight, @Nullable String permission, @NotNull List<GUIActionConfiguration> actions, @NotNull ItemStack itemHasPermission, @Nullable ItemStack itemWhenUsing, @Nullable ItemStack itemNoPermission)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkPermission(Player player)
判断某玩家是否有权限使用该前缀void
executeActions(@NotNull Player player)
@NotNull String
getContent()
@NotNull String
getIdentifier()
protected @Nullable ItemStack
getItem(@Nullable Player player, @Nullable ItemStack item)
@NotNull ItemStack
getItemHasPermission(@Nullable Player player)
@Nullable ItemStack
getItemNoPermission(@Nullable Player player)
@Nullable ItemStack
getItemWhenUsing(@Nullable Player player)
@NotNull String
getName()
@Nullable String
getPermission()
int
getWeight()
boolean
isPublic()
boolean
isVisible(Player player)
-
-
-
Field Detail
-
identifier
@NotNull protected final @NotNull String identifier
-
name
@NotNull protected final @NotNull String name
-
content
@NotNull protected final @NotNull String content
-
weight
protected final int weight
-
permission
@Nullable protected final @Nullable String permission
-
actions
@NotNull protected final @NotNull List<GUIActionConfiguration> actions
-
itemHasPermission
@NotNull protected final @NotNull ItemStack itemHasPermission
-
itemNoPermission
@Nullable protected final @Nullable ItemStack itemNoPermission
-
itemWhenUsing
@Nullable protected final @Nullable ItemStack itemWhenUsing
-
-
Constructor Detail
-
PrefixConfig
public PrefixConfig(@NotNull @NotNull String identifier, @NotNull @NotNull String name, @NotNull @NotNull String content, int weight, @Nullable @Nullable String permission, @NotNull @NotNull List<GUIActionConfiguration> actions, @NotNull @NotNull ItemStack itemHasPermission, @Nullable @Nullable ItemStack itemWhenUsing, @Nullable @Nullable ItemStack itemNoPermission)
-
-
Method Detail
-
getIdentifier
@NotNull public @NotNull String getIdentifier()
-
getName
@NotNull public @NotNull String getName()
-
getContent
@NotNull public @NotNull String getContent()
-
getWeight
public int getWeight()
-
getPermission
@Nullable public @Nullable String getPermission()
-
getItemHasPermission
@NotNull public @NotNull ItemStack getItemHasPermission(@Nullable @Nullable Player player)
-
getItemNoPermission
@Nullable public @Nullable ItemStack getItemNoPermission(@Nullable @Nullable Player player)
-
getItemWhenUsing
@Nullable public @Nullable ItemStack getItemWhenUsing(@Nullable @Nullable Player player)
-
getItem
@Contract("_,!null->!null") @Nullable protected @Nullable ItemStack getItem(@Nullable @Nullable Player player, @Nullable @Nullable ItemStack item)
-
isPublic
public boolean isPublic()
-
executeActions
public void executeActions(@NotNull @NotNull Player player)
-
isVisible
public boolean isVisible(Player player)
-
checkPermission
public boolean checkPermission(Player player)
判断某玩家是否有权限使用该前缀- Parameters:
player
- 玩家- Returns:
- 若前缀标识不存在,则返回false;若前缀为默认前缀,或该前缀无权限,或玩家有该前缀的权限,则返回true。
-
-