Package org.spongepowered.api.world
Interface ChunkRegenerateFlag
- All Superinterfaces:
DefaultedRegistryValue
@CatalogedBy(ChunkRegenerateFlags.class)
public interface ChunkRegenerateFlag
extends DefaultedRegistryValue
A flag of sorts that determines whether a chunk regeneration will perform
various tasks such as creating a chunk, or preserving entities.
-
Method Summary
Modifier and TypeMethodDescriptionandFlag(ChunkRegenerateFlag flag) Gets the equivalentChunkRegenerateFlagof this flag with thetrues set for this flag and the providedflag, such that only if both flags have the sametrueflags set will persist.Gets the equivalentChunkRegenerateFlagof this flag where the providedflaghas its values inverted before performing an and operation between this flag and the provided flag.booleancreate()Gets whether this flag defines that a chunk should be created if it does not exist.booleanentities()Gets whether this flag will preserve entities in chunks that are regenerated.withCreate(boolean create) Gets the equivalentChunkRegenerateFlagof this flag with all other flags while having the desiredcreateas defined by the parameter.withEntities(boolean entities) Gets the equivalentChunkRegenerateFlagof this flag with all other flags while having the desiredentitiesas defined by the parameter.Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
create
boolean create()Gets whether this flag defines that a chunk should be created if it does not exist.- Returns:
- True if this is set to create chunks
-
entities
boolean entities()Gets whether this flag will preserve entities in chunks that are regenerated. Note: It is up to the implementation to decide whether this will include moving entities to safe locations.- Returns:
- True if this is set to preserve entities
-
withCreate
Gets the equivalentChunkRegenerateFlagof this flag with all other flags while having the desiredcreateas defined by the parameter.- Parameters:
create- Whether to create chunk- Returns:
- The relative flag with the desired create
-
withEntities
Gets the equivalentChunkRegenerateFlagof this flag with all other flags while having the desiredentitiesas defined by the parameter.- Parameters:
entities- Whether to preserve entities- Returns:
- The relative flag with the desired entities
-
andFlag
Gets the equivalentChunkRegenerateFlagof this flag with thetrues set for this flag and the providedflag, such that only if both flags have the sametrueflags set will persist.For example, if this flag has
create()and the incoming flag hascreate()returningtrue, the resulting flag will havecreate()returntrueas well. The inverse is also true. If either has differing flags for any of the above methods, the resulting flag will have afalsevalue.- Parameters:
flag- The incoming flag to and with this flag- Returns:
- The resulting flag with matched values
-
andNotFlag
Gets the equivalentChunkRegenerateFlagof this flag where the providedflaghas its values inverted before performing an and operation between this flag and the provided flag. Therefore, the returned flag will only havetruefor a value if the value istruefor this flag andfalsefor the provided flag.- Parameters:
flag- The incoming flag to compare against- Returns:
- The resulting flag with matched values
-