Class StructureSnapshot
- All Implemented Interfaces:
IStructureConst, IPropertyHolderConst
All access to this class is thread safe and does not lock.
Please read the documentation of nl.pim16aap2.animatedarchitecture.core.structures for more information about
the structure system.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this structure can move perpetually.voidforEach(Consumer<? super PropertyValuePair<?>> action) Gets the rectangle describing the limits within an animation of this door takes place.Gets theCuboidrepresenting the area taken up by this structure.Cycle theMovementDirectiondirection thisStructurewill open in.doubleGets the lower time limit for an animation.getName()Gets the name of this structure.Gets theMovementDirectionthisStructurewill open if currently closed.Attempts to get theStructureOwnerof this structure represented by the UUID of a player.Gets allStructureOwners of this structure, including the original creator.Gets the position of power block of this structure.Gets the prime owner (permission = 0) of this structure.Gets thePropertyContainerSnapshotof this structure.<T> IPropertyValue<T> getPropertyValue(Property<T> property) Gets the value of the given property.<T> TgetRequiredPropertyValue(Property<T> property) Gets the value of a required property.Returns a (read-only)StructureSnapshotof this structure.getType()Returns theStructureTypeof this structure.longgetUid()Gets the UID of theStructureas used in the database.getWorld()Gets the IWorld thisStructureexists in.booleanhasProperties(Collection<Property<?>> properties) Checks if this property holder has all the given properties.booleanhasProperties(SequencedCollection<Property<?>> properties) Checks if this property holder has all the given properties.booleanhasProperties(Property<?>... properties) Checks if this property holder has all the given properties.booleanhasProperty(Property<?> property) Checks if the given property has a value set.booleanbooleanisLocked()Check if theStructureis currently locked.booleanChecks if a player with a given UUID is a (co-)owner of this structure with any level of ownership.booleanisOwner(UUID uuid, PermissionLevel permissionLevel) Checks if a player with a given UUID is a (co-)owner of this structure with a given level of ownership.iterator()intGets the number of properties in this property container.stream()@NonNull StringtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IStructureConst
equals, getBasicInfo, getBlockCount, getChunkId, getDimensions, getMaximum, getMinimum, getNameAndUid, getOwner, getPermissionLevel, getPermissionLevel, isOwner, isOwner
-
Method Details
-
getOwner
Description copied from interface:IStructureConstAttempts to get theStructureOwnerof this structure represented by the UUID of a player.- Specified by:
getOwnerin interfaceIStructureConst- Parameters:
player- The UUID of the player that may or may not be an owner of this structure.- Returns:
- The
StructureOwnerof this structure for the given player, if this player is aStructureOwnerof this structure.
-
isOwner
Description copied from interface:IStructureConstChecks if a player with a given UUID is a (co-)owner of this structure with any level of ownership.If the level of ownership matters, use
IStructureConst.getOwner(UUID)instead.- Specified by:
isOwnerin interfaceIStructureConst- Parameters:
player- The UUID of a player.- Returns:
- True if the player with the given UUID is an owner of this structure with any level of ownership.
-
isOwner
Description copied from interface:IStructureConstChecks if a player with a given UUID is a (co-)owner of this structure with a given level of ownership.- Specified by:
isOwnerin interfaceIStructureConst- Parameters:
uuid- The UUID of a player.permissionLevel- The maximum level of ownership the player may have.E.g. when permissionLevel is
PermissionLevel.ADMIN, this method will return true if the player has admin access or lower (PermissionLevel.ADMINorPermissionLevel.CREATOR).- Returns:
- True if the player with the given UUID is an owner of this structure with the given level of ownership (or lower).
-
canMovePerpetually
public boolean canMovePerpetually()Description copied from interface:IStructureConstChecks if this structure can move perpetually.- Specified by:
canMovePerpetuallyin interfaceIStructureConst- Returns:
- True if this structure can move perpetually.
-
getOwners
Description copied from interface:IStructureConstGets allStructureOwners of this structure, including the original creator.- Specified by:
getOwnersin interfaceIStructureConst- Returns:
- All
StructureOwners of this structure, including the original creator.
-
getSnapshot
Description copied from interface:IStructureConstReturns a (read-only)StructureSnapshotof this structure.Repeated calls to this method may or may not return the same instance unless the underlying structure has been modified, in which case a new snapshot reflecting the changes will be returned.
- Specified by:
getSnapshotin interfaceIStructureConst- Returns:
- A
StructureSnapshotof this structure.
-
getUid
public long getUid()Description copied from interface:IStructureConstGets the UID of theStructureas used in the database. Guaranteed to be unique and available.- Specified by:
getUidin interfaceIStructureConst- Returns:
- The UID of the
Structureas used in the database.
-
getWorld
Description copied from interface:IStructureConstGets the IWorld thisStructureexists in.- Specified by:
getWorldin interfaceIStructureConst- Returns:
- The IWorld this
Structureexists in
-
getAnimationRange
Description copied from interface:IStructureConstGets the rectangle describing the limits within an animation of this door takes place.At no point during an animation will any animated block leave this cuboid, though not guarantees are given regarding how tight the cuboid fits around the animated blocks.
- Specified by:
getAnimationRangein interfaceIStructureConst- Returns:
- The animation range.
-
getPowerBlock
Description copied from interface:IStructureConstGets the position of power block of this structure.- Specified by:
getPowerBlockin interfaceIStructureConst- Returns:
- The position of the power block of this structure.
-
getName
Description copied from interface:IStructureConstGets the name of this structure.- Specified by:
getNamein interfaceIStructureConst- Returns:
- The name of this structure.
-
getCuboid
Description copied from interface:IStructureConstGets theCuboidrepresenting the area taken up by this structure.- Specified by:
getCuboidin interfaceIStructureConst- Returns:
- The
Cuboidrepresenting the area taken up by this structure.
-
getOpenDirection
Description copied from interface:IStructureConstGets theMovementDirectionthisStructurewill open if currently closed.Note that if it's currently in the open status, it is supposed go in the opposite direction, as the closing direction is the opposite of the opening direction. This isn't taken into account by this method.
- Specified by:
getOpenDirectionin interfaceIStructureConst- Returns:
- The
MovementDirectionthisStructurewill open in.
-
isLocked
public boolean isLocked()Description copied from interface:IStructureConstCheck if theStructureis currently locked. When locked, structures cannot be opened.- Specified by:
isLockedin interfaceIStructureConst- Returns:
- True if the
Structureis locked
-
getPrimeOwner
Description copied from interface:IStructureConstGets the prime owner (permission = 0) of this structure. In most cases, this will be the original creator of the structure.- Specified by:
getPrimeOwnerin interfaceIStructureConst- Returns:
- The prime owner of this structure.
-
getOwnersMap
-
getType
Description copied from interface:IStructureConstReturns theStructureTypeof this structure.- Specified by:
getTypein interfaceIStructureConst- Returns:
- The
StructureTypeof this structure.
-
getCycledOpenDirection
Description copied from interface:IStructureConstCycle theMovementDirectiondirection thisStructurewill open in. By default, it will loop over all valid directions. SeeStructureType.getValidOpenDirectionsList(). However, subclasses may override this behavior.Note that this does not actually change the open direction; it merely tells you which direction comes next!
- Specified by:
getCycledOpenDirectionin interfaceIStructureConst- Returns:
- The new
MovementDirectiondirection thisStructurewill open in.
-
getMinimumAnimationTime
public double getMinimumAnimationTime()Description copied from interface:IStructureConstGets the lower time limit for an animation.Because animated blocks have a speed limit, as determined by
IConfig.maxBlockSpeed(), there is also a minimum amount of time for its animation.The exact time limit depends on the shape, size, and type of structure.
- Specified by:
getMinimumAnimationTimein interfaceIStructureConst- Returns:
- The lower animation time limit for this structure in seconds.
-
isCanMovePerpetually
public boolean isCanMovePerpetually() -
toString
-
getPropertyContainerSnapshot
Description copied from interface:IStructureConstGets thePropertyContainerSnapshotof this structure.- Specified by:
getPropertyContainerSnapshotin interfaceIStructureConst- Returns:
- The
PropertyContainerSnapshotof this structure.
-
iterator
-
spliterator
-
stream
-
getPropertyValue
Description copied from interface:IPropertyHolderConstGets the value of the given property.- Specified by:
getPropertyValuein interfaceIPropertyHolderConst- Type Parameters:
T- The type of the property.- Parameters:
property- The property to get the value of.- Returns:
- The value of the property.
-
getRequiredPropertyValue
Description copied from interface:IPropertyHolderConstGets the value of a required property.If the property has no value set or the value is
null, aNullPointerExceptionis thrown.- Specified by:
getRequiredPropertyValuein interfaceIPropertyHolderConst- Type Parameters:
T- The type of the property.- Parameters:
property- The property to get the value of.- Returns:
- The raw value of the property.
-
hasProperty
Description copied from interface:IPropertyHolderConstChecks if the given property has a value set.- Specified by:
hasPropertyin interfaceIPropertyHolderConst- Parameters:
property- The property to check.- Returns:
trueif the property has a value set,falseotherwise.
-
hasProperties
Description copied from interface:IPropertyHolderConstChecks if this property holder has all the given properties.- Specified by:
hasPropertiesin interfaceIPropertyHolderConst- Parameters:
properties- The properties to check.- Returns:
trueif this property holder has all the given properties,falseotherwise.
-
hasProperties
Description copied from interface:IPropertyHolderConstChecks if this property holder has all the given properties.- Specified by:
hasPropertiesin interfaceIPropertyHolderConst- Parameters:
properties- The properties to check.- Returns:
trueif this property holder has all the given properties,falseotherwise.
-
hasProperties
Description copied from interface:IPropertyHolderConstChecks if this property holder has all the given properties.- Specified by:
hasPropertiesin interfaceIPropertyHolderConst- Parameters:
properties- The properties to check.- Returns:
trueif this property holder has all the given properties,falseotherwise.
-
propertyCount
public int propertyCount()Description copied from interface:IPropertyHolderConstGets the number of properties in this property container.This is the number of entries in the property map.
- Specified by:
propertyCountin interfaceIPropertyHolderConst- Returns:
- The number of properties in this property container.
-
forEach
-