Enum Class Side
- All Implemented Interfaces:
Serializable, Comparable<Side>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic SideAdds multipleSides.static SideGets aSidefrom its id.static Sideget(boolean client, boolean server) Gets a side object that matches the given availability on client and server.static Sidestatic SideReturns the enum constant of this class with the specified name.static Side[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLIENT
Only the physical client without server. -
SERVER
Only the dedicated server without the client. -
COMMON
Both client and server.
-
-
Field Details
-
id
The id of this side. -
client
public final boolean clientWhether this side includes the client. -
server
public final boolean serverWhether this side includes the dedicated server.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
byId
Gets aSidefrom its id.- Throws:
IllegalArgumentException- if an invalid id is given.
-
get
Gets a side object that matches the given availability on client and server. If bothclientandserverarefalse,nullis returned. -
merge
Merges multipleSides to return aSidethat includes all of them. Merging zero sides returnsCOMMON. Otherwise ifsidescontains onlyCLIENTvalues,CLIENTis returned, ifsidescontains onlySERVERvalues,SERVERis returned. Ifsidescontains bothCLIENTandSERVERor containsCOMMON,COMMONis returned. -
and
Adds multipleSides. This can be used to determine the required side for transitive dependencies. Suppose a modAis installed on sidesideAand has a dependency for sidesideB.and(sideA, sideB)would then be the side, on which the dependency is required.If the dependency is not required at all (for example because mod A is only installed on the server but mod B is a client only dependency of mod A), this method returns
null.
-