Package org.spongepowered.api.map
Interface MapCanvas.Builder
- All Superinterfaces:
ResettableBuilder<MapCanvas,
MapCanvas.Builder>
- Enclosing interface:
- MapCanvas
A builder that creates a
MapCanvas
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates aMapCanvas
from the state of this builder.fromContainer
(DataView container) Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.Fills a canvas from an image This given image will be copied and thus changes to the image after this is called will not be reflected.Sets the rectangle bounded by the given co-ordinates to the suppliedMapColor
.default MapCanvas.Builder
Sets the rectangle bounded by the given co-ordinates to the suppliedMapColor
.Sets the entire canvas to the suppliedMapColor
.Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
Method Details
-
paintAll
Sets the entire canvas to the suppliedMapColor
.- Parameters:
color
- TheMapColor
- Returns:
- this builder, for chaining
-
paint
Sets the rectangle bounded by the given co-ordinates to the suppliedMapColor
.The provided co-ordinates are included in the region.
- Parameters:
startX
- Bottom left corner of region to paintstartY
- Bottom left corner of region to paintendX
- Top right corner of region to paintendY
- Top right corner of region to paintmapColor
- TheMapColor
to paint the given region- Returns:
- this builder, for chaining
-
paint
Sets the rectangle bounded by the given co-ordinates to the suppliedMapColor
.The provided co-ordinates are included in the region.
-
from
- Parameters:
canvas
-MapCanvas
to set the state of this builder to- Returns:
- this builder, for chaining
-
fromImage
Fills a canvas from an image This given image will be copied and thus changes to the image after this is called will not be reflected.- Parameters:
image
- to take from- Returns:
- This Builder, for chaining
- Throws:
IllegalArgumentException
- if width/height is wrong or not known yetIllegalArgumentException
- if color found is not in the paletteMapColorTypes
-
fromContainer
Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.- Parameters:
container
- The container to translate- Returns:
- This builder, for chaining
-
build
MapCanvas build()Creates aMapCanvas
from the state of this builder.- Returns:
- The
MapCanvas
-