public final class Platform
extends java.lang.Object
implements java.io.Serializable
== operator to be used with it.
Created by Pepijn on 11-12-2016.
| Modifier and Type | Class and Description |
|---|---|
static class |
Platform.Capability |
| Modifier and Type | Field and Description |
|---|---|
static org.pepsoft.util.AttributeKey<java.lang.String> |
ATTRIBUTE_GRASS_BLOCK_NAME
The name of the "grass block" block type for the platform.
|
static org.pepsoft.util.AttributeKey<java.lang.Integer> |
ATTRIBUTE_WATER_OPACITY
The opacity of a water block.
|
java.util.Map<java.lang.String,java.io.Serializable> |
attributes
Additional custom defined attributes that do not apply to all platforms.
|
java.util.Set<Platform.Capability> |
capabilities
The set of capabilities supported by this platform.
|
java.lang.String |
displayName
The human-friendly display name of this platform.
|
java.lang.String |
id
The globally unique ID of this platform.
|
int[] |
maxHeights
The list of maxHeights to present to the user.
|
int |
maxMaxHeight
The highest upper build limit supported by this platform.
|
int |
maxMinHeight
The highest lower build limit of maps for this platform.
|
int |
maxX
The highest possible X coordinate (in blocks) for this platform.
|
int |
maxY
The highest possible Y coordinate (in blocks) for this platform.
|
int[] |
minHeights
The list of minHeights to present to the user.
|
int |
minMaxHeight
The lowest upper build limit supported by this platform.
|
int |
minMinHeight
The lowest lower build limit of maps for this platform.
|
int |
minX
The lowest possible X coordinate (in blocks) for this platform.
|
int |
minY
The lowest possible Y coordinate (in blocks) for this platform.
|
int |
minZ
The default lower build limit of maps for this platform.
|
int |
standardMaxHeight
The default upper build limit of maps for this platform.
|
java.util.List<java.lang.Integer> |
supportedDimensions
The list of dimension IDs supported by this platform.
|
java.util.List<GameType> |
supportedGameTypes
Get the list of game types supported by this platform.
|
java.util.List<Generator> |
supportedGenerators
The list of generators supported by this platform.
|
| Constructor and Description |
|---|
Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int[] minHeights,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
Define a new platform which has variable
minHeights. |
Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities)
Deprecated.
|
Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
Define a new platform which has a fixed
minHeight other than zero. |
Platform(java.lang.String id,
java.lang.String displayName,
int minMaxHeight,
int standardMaxHeight,
int maxMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGenerators,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities)
Deprecated.
|
Platform(java.lang.String id,
java.lang.String displayName,
int minMaxHeight,
int standardMaxHeight,
int maxMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
Define a new platform which only supports a
minHeight of zero. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
<T extends java.io.Serializable> |
getAttribute(org.pepsoft.util.AttributeKey<T> key)
Convenience method for getting an attribute value.
|
static Platform |
getById(java.lang.String id) |
int |
hashCode() |
java.lang.String |
isCompatible(World2 world)
Determines whether a world could be retargeted to this platform without requiring any changes or edits.
|
boolean |
supportsBiomes()
Convenience method for determining whether the platform supports any type of biomes
(
capabilities contains Platform.Capability.BIOMES, Platform.Capability.BIOMES_3D or
Platform.Capability.NAMED_BIOMES). |
java.lang.String |
toString() |
public final java.lang.String id
public final java.lang.String displayName
public final int minMaxHeight
public final int standardMaxHeight
public final int maxMaxHeight
public final int minX
public final int maxX
public final int minY
public final int maxY
public final java.util.List<GameType> supportedGameTypes
public final java.util.List<Generator> supportedGenerators
public final java.util.List<java.lang.Integer> supportedDimensions
public final java.util.Set<Platform.Capability> capabilities
public final int[] maxHeights
public final int minZ
public final java.util.Map<java.lang.String,java.io.Serializable> attributes
null.public final int minMinHeight
public final int maxMinHeight
public final int[] minHeights
public static final org.pepsoft.util.AttributeKey<java.lang.String> ATTRIBUTE_GRASS_BLOCK_NAME
minecraft:grass_block.public static final org.pepsoft.util.AttributeKey<java.lang.Integer> ATTRIBUTE_WATER_OPACITY
public Platform(java.lang.String id,
java.lang.String displayName,
int minMaxHeight,
int standardMaxHeight,
int maxMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
minHeight of zero. This version of the constructor
auto-generates the list of maxHeights from the minMaxHeight and maxMaxHeight, instead of
having to specify the list explicitly. The list will contain every power of two between minMaxHeight and
maxMaxHeight.id - The globally unique identifier, preferably in Java package/reverse domain name style, of the platform. This must never change.displayName - The name of the platform to display to the user.minMaxHeight - The minimum maxHeight supported by the platform.standardMaxHeight - The default maxHeight of the platform. The maxHeight is exclusive.maxMaxHeight - The maximum maxHeight supported by the platform.minX - The lowest possible x (east-west) coordinate supported by the platform.maxX - The highest possible x (east-west) coordinate supported by the platform.minY - The lowest possible y (north-south) coordinate supported by the platform.maxY - The highest possible y (north-south) coordinate supported by the platform.supportedGameTypes - The game types supported by the platform.supportedGeneratorTypes - The generator types supported by the platform.supportedDimensions - The dimensions supported by the platform as expressed by the constants Constants.DIM_NORMAL, Constants.DIM_NETHER and Constants.DIM_END.capabilities - The capabilities of the platform.attributes - Optional custom attributes of the platform. If specified there must be an even number of values, which form key-value pairs. The keys must be Strings and the values must be Serializable.public Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
minHeight other than zero.id - The globally unique identifier, preferably in Java package/reverse domain name style, of the platform. This must never change.displayName - The name of the platform to display to the user.maxHeights - The list of maxHeights to present to the user. The platform may support maxHeights not in this list. The list must be in ascending order.standardMaxHeight - The default maxHeight of the platform. The maxHeight is exclusive.minX - The lowest possible x (east-west) coordinate supported by the platform.maxX - The highest possible x (east-west) coordinate supported by the platform.minY - The lowest possible y (north-south) coordinate supported by the platform.maxY - The highest possible y (north-south) coordinate supported by the platform.standardMinHeight - The default minHeight of the platform. The minHeight is inclusive.supportedGameTypes - The game types supported by the platform.supportedGeneratorTypes - The generator types supported by the platform.supportedDimensions - The dimensions supported by the platform as expressed by the constants Constants.DIM_NORMAL, Constants.DIM_NETHER and Constants.DIM_END.capabilities - The capabilities of the platform.attributes - Optional custom attributes of the platform. If specified there must be an even number of values, which form key-value pairs. The keys must be Strings and the values must be Serializable.public Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int[] minHeights,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities,
java.lang.Object... attributes)
minHeights.id - The globally unique identifier, preferably in Java package/reverse domain name style, of the platform. This must never change.displayName - The name of the platform to display to the user.maxHeights - The list of maxHeights to present to the user. The platform may support maxHeights not in this list. The list must be in ascending order.standardMaxHeight - The default maxHeight of the platform. The maxHeight is exclusive.minX - The lowest possible x (east-west) coordinate supported by the platform.maxX - The highest possible x (east-west) coordinate supported by the platform.minY - The lowest possible y (north-south) coordinate supported by the platform.maxY - The highest possible y (north-south) coordinate supported by the platform.minHeights - The minHeights supported by the platform. The list must be in descending order.standardMinHeight - The default minHeight of the platform. The minHeight is inclusive.supportedGameTypes - The game types supported by the platform.supportedGeneratorTypes - The generator types supported by the platform.supportedDimensions - The dimensions supported by the platform as expressed by the constants Constants.DIM_NORMAL, Constants.DIM_NETHER and Constants.DIM_END.capabilities - The capabilities of the platform.attributes - Optional custom attributes of the platform. If specified there must be an even number of values, which form key-value pairs. The keys must be Strings and the values must be Serializable.@Deprecated
public Platform(java.lang.String id,
java.lang.String displayName,
int minMaxHeight,
int standardMaxHeight,
int maxMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGenerators,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities)
@Deprecated
public Platform(java.lang.String id,
java.lang.String displayName,
int[] maxHeights,
int standardMaxHeight,
int minX,
int maxX,
int minY,
int maxY,
int standardMinHeight,
java.util.List<GameType> supportedGameTypes,
java.util.List<Generator> supportedGeneratorTypes,
java.util.List<java.lang.Integer> supportedDimensions,
java.util.Set<Platform.Capability> capabilities)
public java.lang.String isCompatible(World2 world)
world - The world to check for compatibility.null if the world could be trivially retargeted to this platform, or a short description of the
reason if it cannot.public boolean supportsBiomes()
capabilities contains Platform.Capability.BIOMES, Platform.Capability.BIOMES_3D or
Platform.Capability.NAMED_BIOMES).public <T extends java.io.Serializable> T getAttribute(org.pepsoft.util.AttributeKey<T> key)
key.defaultValue is
returned.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static Platform getById(java.lang.String id)