Package com.sk89q.worldedit
Class EditSessionBuilder
java.lang.Object
com.sk89q.worldedit.EditSessionBuilder
A builder-style factory for
EditSessions
.-
Method Summary
Modifier and TypeMethodDescriptionSet the actor who owns theEditSession
.allowedRegions
(RegionWrapper allowedRegion) Set the region the edit is allowed to operate in.allowedRegions
(RegionWrapper[] allowedRegions) Deprecated.allowedRegions
(Region[] allowedRegions) Set the regions the edit is allowed to operate in.Set the edit to be allowed to edit everywhereSet the block bag for theEditSession
.build()
Build theEditSession
using properties described in this builder.Create a new changeset to be used for the edit's history.changeSet
(AbstractChangeSet changeSet) Set the changeset to be used for historyDo not process any historycheckMemory
(Boolean checkMemory) Override if memory usage should be checked during editsession compilation.combineStages
(Boolean combineStages) Record history with dispatching:, - Much faster as it avoids duplicate block checks, - Slightly worse compression since dispatch order is different.Set the command used that created this edit.compile()
Compile the builder to the settings given.disallowedRegions
(RegionWrapper disallowedRegion) Set the region the edit is allowed to operate in.disallowedRegions
(RegionWrapper[] disallowedRegions) Deprecated.disallowedRegions
(Region[] disallowedRegions) Set the regions the edit is allowed to operate in.event
(EditSessionEvent event) Set theEditSessionEvent
instance to be used for firing at different stages of preparationSet fast mode.forceWNA()
Force WNA to be used instead of FAWE's queue system.getActor()
Get the actor associated with the edit if present or nullRegion[]
get the allowed regions associated with the edit's restricttionsGet theBlockBag
associated with the edit if present or nullGet the base extent that blocks are set to, bypassing any restrictions, limits and history.Get the base extent that blocks are set to, bypassing any restrictions, limits and history.Get the change set that will be used for historyGet the ultimate resultant extentgetLimit()
Get the edit's limitsint
Get the maximum number of block changes allowedGet the relight engine to be usedgetWorld()
Get the world to be edited if present or nullboolean
Check if tracing is enabled.boolean
If the edit will force using WNAboolean
If anEditSessionEvent
has been fired yetSet the limit(s) for the edit to useSet the edit to be able to edit everywhere, and for any number of blockslimitUnprocessed
(Actor player) Unlimited in regions/block changes, but uses the givenActor
's inventory mode.<A extends Actor & Locatable>
EditSessionBuilderlocatableActor
(A locatable) Set the actor to one with a location/extent associated.maxBlocks
(int maxBlocks) Set the maximum blocks to change for theEditSession
.relightMode
(RelightMode relightMode) Set theRelightMode
tracing
(boolean tracing) Set tracing enabled/disabled.Set the world for theEditSession
.
-
Method Details
-
world
Set the world for theEditSession
.- Parameters:
world
- the world- Returns:
- this builder
-
getWorld
Get the world to be edited if present or null -
getMaxBlocks
public int getMaxBlocks()Get the maximum number of block changes allowed -
maxBlocks
Set the maximum blocks to change for theEditSession
.- Parameters:
maxBlocks
- the maximum blocks to change- Returns:
- this builder
-
getActor
Get the actor associated with the edit if present or null -
actor
Set the actor who owns theEditSession
.- Parameters:
actor
- the actor- Returns:
- this builder
-
getBlockBag
Get theBlockBag
associated with the edit if present or null -
blockBag
Set the block bag for theEditSession
.- Parameters:
blockBag
- the block bag- Returns:
- this builder
-
isTracing
public boolean isTracing()Check if tracing is enabled. Internal use only. -
tracing
Set tracing enabled/disabled. Internal use only. -
locatableActor
Set the actor to one with a location/extent associated. Sets both the actor and the world. -
build
Build theEditSession
using properties described in this builder.- Returns:
- the new EditSession
-
event
Set theEditSessionEvent
instance to be used for firing at different stages of preparation -
limit
Set the limit(s) for the edit to use -
limitUnlimited
Set the edit to be able to edit everywhere, and for any number of blocks -
limitUnprocessed
Unlimited in regions/block changes, but uses the givenActor
's inventory mode. -
changeSet
Set the changeset to be used for history -
changeSetNull
Do not process any history -
command
Set the command used that created this edit. Used inRollbackOptimizedHistory
-
changeSet
Create a new changeset to be used for the edit's history.- Parameters:
disk
- If disk should be used for history storageuuid
- UUID to be used for the history or null if unneeded.
-
allowedRegions
Set the regions the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
allowedRegions
Deprecated.Set the regions the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
allowedRegions
Set the region the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
disallowedRegions
Set the regions the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
disallowedRegions
@Deprecated public EditSessionBuilder disallowedRegions(@Nullable RegionWrapper[] disallowedRegions) Deprecated.Set the regions the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
disallowedRegions
Set the region the edit is allowed to operate in. Set to null for the regions to be calculated based on the actor if present -
allowedRegionsEverywhere
Set the edit to be allowed to edit everywhere -
fastMode
Set fast mode. Use null to set to actor's fast mode setting. Also set to true by default if history for console disabled -
relightMode
Set theRelightMode
-
checkMemory
Override if memory usage should be checked during editsession compilation. By default, checks memory if fastmode is not enabled and actor is not null. -
combineStages
Record history with dispatching:, - Much faster as it avoids duplicate block checks, - Slightly worse compression since dispatch order is different. -
compile
Compile the builder to the settings given. Prepares history, limits, lighting, etc. -
getRelighter
Get the relight engine to be used -
isWNAMode
public boolean isWNAMode()If the edit will force using WNA -
getAllowedRegions
get the allowed regions associated with the edit's restricttions -
forceWNA
Force WNA to be used instead of FAWE's queue system. Will use more memory, be slower, and more likely to cause issues. -
isWrapped
public boolean isWrapped()If anEditSessionEvent
has been fired yet -
getBypassHistory
Get the base extent that blocks are set to, bypassing any restrictions, limits and history. All extents up to and includingEditSession.Stage.BEFORE_REORDER
-
getBypassAll
Get the base extent that blocks are set to, bypassing any restrictions, limits and history. All extents up to and includingEditSession.Stage.BEFORE_CHANGE
-
getLimit
Get the edit's limits -
getChangeTask
Get the change set that will be used for history -
getExtent
Get the ultimate resultant extent
-