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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChunkRegenerateFlag
andFlag(ChunkRegenerateFlag flag)
Gets the equivalentChunkRegenerateFlag
of this flag with thetrue
s set for this flag and the providedflag
, such that only if both flags have the sametrue
flags set will persist.ChunkRegenerateFlag
andNotFlag(ChunkRegenerateFlag flag)
Gets the equivalentChunkRegenerateFlag
of this flag where the providedflag
has its values inverted before performing an and operation between this flag and the provided flag.boolean
create()
Gets whether this flag defines that a chunk should be created if it does not exist.boolean
entities()
Gets whether this flag will preserve entities in chunks that are regenerated.ChunkRegenerateFlag
withCreate(boolean create)
Gets the equivalentChunkRegenerateFlag
of this flag with all other flags while having the desiredcreate
as defined by the parameter.ChunkRegenerateFlag
withEntities(boolean entities)
Gets the equivalentChunkRegenerateFlag
of this flag with all other flags while having the desiredentities
as defined by the parameter.-
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
-
-
-
Method Detail
-
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
ChunkRegenerateFlag withCreate(boolean create)
Gets the equivalentChunkRegenerateFlag
of this flag with all other flags while having the desiredcreate
as defined by the parameter.- Parameters:
create
- Whether to create chunk- Returns:
- The relative flag with the desired create
-
withEntities
ChunkRegenerateFlag withEntities(boolean entities)
Gets the equivalentChunkRegenerateFlag
of this flag with all other flags while having the desiredentities
as defined by the parameter.- Parameters:
entities
- Whether to preserve entities- Returns:
- The relative flag with the desired entities
-
andFlag
ChunkRegenerateFlag andFlag(ChunkRegenerateFlag flag)
Gets the equivalentChunkRegenerateFlag
of this flag with thetrue
s set for this flag and the providedflag
, such that only if both flags have the sametrue
flags set will persist.For example, if this flag has
create()
and the incoming flag hascreate()
returningtrue
, the resulting flag will havecreate()
returntrue
as well. The inverse is also true. If either has differing flags for any of the above methods, the resulting flag will have afalse
value.- Parameters:
flag
- The incoming flag to and with this flag- Returns:
- The resulting flag with matched values
-
andNotFlag
ChunkRegenerateFlag andNotFlag(ChunkRegenerateFlag flag)
Gets the equivalentChunkRegenerateFlag
of this flag where the providedflag
has its values inverted before performing an and operation between this flag and the provided flag. Therefore, the returned flag will only havetrue
for a value if the value istrue
for this flag andfalse
for the provided flag.- Parameters:
flag
- The incoming flag to compare against- Returns:
- The resulting flag with matched values
-
-