Class VerticalPlatformer
java.lang.Object
ua.mcchickenstudio.opencreative.utils.world.platforms.DevPlatformer
ua.mcchickenstudio.opencreative.utils.world.platforms.VerticalPlatformer
- All Implemented Interfaces:
ExtensionContent
VerticalPlatformer
This class represents a platforms generator, that creates and returns platforms in vertical way, like old floors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<Void> buildPlatform(@NotNull DevPlatform platform, org.bukkit.Material floorMaterial, org.bukkit.Material eventMaterial, org.bukkit.Material actionMaterial) Builds coding platform by its coordinates.booleanclaimPlatform(@NotNull DevPlanet devPlanet, @NotNull DevPlatform platform) Claims coding platform, if it doesn't exist yet.intgetCodingBlocksLimit(@NotNull DevPlanet planet) Returns maximum amount of coding blocks in 1 column.@Nullable org.bukkit.LocationgetColumnBeginLocation(@NotNull DevPlanet devPlanet, @NotNull org.bukkit.Location location) Returns begin location of coding line by location.@NotNull StringReturns description of extension content.@NotNull StringReturns lower-cased simple id of extension.@NotNull DevPlatformgetFarPlatformByX(@NotNull DevPlanet devPlanet) Returns the most far platform by X coordinate.@NotNull DevPlatformgetFarPlatformByZ(@NotNull DevPlanet devPlanet) Returns the most far platform by Z coordinate.@NotNull StringgetName()Returns name of extension content.@NotNull DevPlatformgetNextAvailablePlatform(@NotNull DevPlanet planet) Returns next platform, that will be created by player.@NotNull org.bukkit.LocationgetPlatformBeginLocation(@NotNull DevPlatform platform) Returns location of top left corner of platform.@NotNull org.bukkit.LocationgetPlatformEndLocation(@NotNull DevPlatform platform) Returns location of bottom right corner of platform.@Nullable DevPlatformgetPlatformInLocation(@NotNull DevPlanet devPlanet, @NotNull org.bukkit.Location location) Returns coding platform by location.@NotNull List<@NotNull DevPlatform> getPlatforms(@NotNull DevPlanet devPlanet) Returns list of existing coding platforms, that can be used to place coding blocks.booleanChecks if this manager creates platforms on Z coordinate instead of Y coordinate.voidsetWorldBorder(@NotNull DevPlanet devPlanet) Sets world border for developer planet.Methods inherited from class DevPlatformer
getID, hashCode
-
Constructor Details
-
VerticalPlatformer
public VerticalPlatformer()
-
-
Method Details
-
setWorldBorder
Description copied from class:DevPlatformerSets world border for developer planet.- Specified by:
setWorldBorderin classDevPlatformer- Parameters:
devPlanet- dev planet to set border.
-
getPlatformInLocation
@Nullable public @Nullable DevPlatform getPlatformInLocation(@NotNull @NotNull DevPlanet devPlanet, @NotNull @NotNull org.bukkit.Location location) Description copied from class:DevPlatformerReturns coding platform by location.- Specified by:
getPlatformInLocationin classDevPlatformer- Parameters:
location- location to get platform.- Returns:
- coding platform - if location contains coding platform, otherwise - null.
-
getColumnBeginLocation
@Nullable public @Nullable org.bukkit.Location getColumnBeginLocation(@NotNull @NotNull DevPlanet devPlanet, @NotNull @NotNull org.bukkit.Location location) Description copied from class:DevPlatformerReturns begin location of coding line by location.- Specified by:
getColumnBeginLocationin classDevPlatformer- Parameters:
location- location to get platform.- Returns:
- executor block location - if location is related to actions or its executor location itself.
-
getFarPlatformByX
Description copied from class:DevPlatformerReturns the most far platform by X coordinate.- Specified by:
getFarPlatformByXin classDevPlatformer- Parameters:
devPlanet- developer planet to get platform.- Returns:
- farthest platform by X, or coding platform placed at (1,1).
-
getFarPlatformByZ
Description copied from class:DevPlatformerReturns the most far platform by Z coordinate.- Specified by:
getFarPlatformByZin classDevPlatformer- Parameters:
devPlanet- developer planet to get platform.- Returns:
- farthest platform by Z, or coding platform placed at (1,1).
-
getPlatforms
@NotNull public @NotNull List<@NotNull DevPlatform> getPlatforms(@NotNull @NotNull DevPlanet devPlanet) Description copied from class:DevPlatformerReturns list of existing coding platforms, that can be used to place coding blocks.- Specified by:
getPlatformsin classDevPlatformer- Parameters:
devPlanet- developer planet to get platforms.- Returns:
- list of developer platforms.
-
claimPlatform
public boolean claimPlatform(@NotNull @NotNull DevPlanet devPlanet, @NotNull @NotNull DevPlatform platform) Description copied from class:DevPlatformerClaims coding platform, if it doesn't exist yet.- Specified by:
claimPlatformin classDevPlatformer- Parameters:
devPlanet- developer planet to claim platform.platform- coding platform to claim.- Returns:
- true - claimed coding platform, false - already built and exists.
-
buildPlatform
@NotNull public @NotNull CompletableFuture<Void> buildPlatform(@NotNull @NotNull DevPlatform platform, org.bukkit.Material floorMaterial, org.bukkit.Material eventMaterial, org.bukkit.Material actionMaterial) Description copied from class:DevPlatformerBuilds coding platform by its coordinates. Coordinates are not from Minecraft location.- Specified by:
buildPlatformin classDevPlatformer- Parameters:
platform- platform to create.floorMaterial- material of block, that will be used as floor.eventMaterial- material of block, that will be placed as cells for event blocks placement.actionMaterial- material of block, that will be placed as cells for action blocks placement.- Returns:
- true - created coding platform, false - cannot build it.
-
getPlatformBeginLocation
@NotNull public @NotNull org.bukkit.Location getPlatformBeginLocation(@NotNull @NotNull DevPlatform platform) Description copied from class:DevPlatformerReturns location of top left corner of platform.- Specified by:
getPlatformBeginLocationin classDevPlatformer- Parameters:
platform- dev platform to get location.- Returns:
- begin location of platform.
-
getPlatformEndLocation
@NotNull public @NotNull org.bukkit.Location getPlatformEndLocation(@NotNull @NotNull DevPlatform platform) Description copied from class:DevPlatformerReturns location of bottom right corner of platform.- Specified by:
getPlatformEndLocationin classDevPlatformer- Parameters:
platform- dev platform to get location.- Returns:
- end location of platform.
-
getNextAvailablePlatform
Description copied from class:DevPlatformerReturns next platform, that will be created by player.- Specified by:
getNextAvailablePlatformin classDevPlatformer- Returns:
- next available coding platform.
-
getCodingBlocksLimit
Description copied from class:DevPlatformerReturns maximum amount of coding blocks in 1 column. Includes executor and all actions blocks through coding line.- Specified by:
getCodingBlocksLimitin classDevPlatformer- Returns:
- limit of coding blocks.
-
notDependsOnHeight
public boolean notDependsOnHeight()Description copied from class:DevPlatformerChecks if this manager creates platforms on Z coordinate instead of Y coordinate. Useful for skipping additional checks while parsing coding blocks.- Specified by:
notDependsOnHeightin classDevPlatformer- Returns:
- true - considers only Z or X coordinates, false - considers also Y.
-
getName
Description copied from interface:ExtensionContentReturns name of extension content. Will be displayed in list of extension content.- Returns:
- name of content.
-
getDescription
Description copied from interface:ExtensionContentReturns description of extension content. Describes purpose of new additional content.- Returns:
- description of content.
-
getExtensionId
Description copied from interface:ExtensionContentReturns lower-cased simple id of extension. Will be used to identify author of content.ID "default" is reserved for OpenCreative+ developers.
- Returns:
- id of extension.
-