Class Rank
java.lang.Object
com.minecolonies.api.colony.permissions.Rank
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPermission(Action action) Adds the given action permission if it is not set yetintbooleanintgetId()Get the id of the rankgetName()Get the name of the ranklonginthashCode()booleanGet whether this rank is a colony managerbooleanGet whether this rank is hostilebooleanGet whether this ranks is an initial rank which cannot be deletedbooleanremovePermission(Action action) Adds the given action permission if it is not set yetvoidsetColonyManager(boolean isColonyManager) Set whether this rank is a colony managervoidsetHostile(boolean isHostile) Set whether this rank is hostile
-
Constructor Details
-
Rank
public Rank(int id, long permissionData, String name, boolean isInitial, boolean isColonyManager, boolean isHostile) Rank constructor- Parameters:
id- the id of the rankname- the name of the rankisInitial- whether the rank is an initial rank
-
Rank
-
-
Method Details
-
getId
public int getId()Get the id of the rank- Returns:
- the id
-
getName
Get the name of the rank- Returns:
- the name
-
isInitial
public boolean isInitial()Get whether this ranks is an initial rank which cannot be deleted- Returns:
- true if so
-
isColonyManager
public boolean isColonyManager()Get whether this rank is a colony manager- Returns:
- true if so
-
isHostile
public boolean isHostile()Get whether this rank is hostile- Returns:
- true if so
-
setColonyManager
public void setColonyManager(boolean isColonyManager) Set whether this rank is a colony manager- Parameters:
isColonyManager- whether the rank is a colony manager
-
setHostile
public void setHostile(boolean isHostile) Set whether this rank is hostile- Parameters:
isHostile- whether the rank is hostile
-
equals
-
hashCode
public int hashCode() -
compareTo
-
addPermission
Adds the given action permission if it is not set yet- Parameters:
action-- Returns:
-
removePermission
Adds the given action permission if it is not set yet- Parameters:
action-- Returns:
-
getPermissions
public long getPermissions()
-