Interface Loopable<T>
- All Known Subinterfaces:
DefaultExpression<T>, Expression<T>, KeyedIterableExpression<T>, KeyProviderExpression<T>, KeyReceiverExpression<T>, Literal<T>
- All Known Implementing Classes:
ContainerExpression, ConvertedExpression, ConvertedKeyProviderExpression, ConvertedLiteral, ch.njol.skript.expressions.base.EventValueExpression, ExprAllPersistentDataKeys, ExprBookAuthor, ExprBookPages, ExprBookTitle, ExprBreedingFamily, ExprBrewingFuelLevel, ExprBrewingResults, ExprBrewingSlot, ExprBrewingTime, ExprBroadcastMessage, ExprCausingEntity, ExprChatFormat, ExprChatMessage, ExprChatRecipients, ExprColored, ExprColorFromHexCode, ExprCreatedDamageSource, ExprCurrentInputKeys, ExprDamageLocation, ExprDamageType, ExprDeathMessage, ExprDirectEntity, ExprDisplayBillboard, ExprDisplayBrightness, ExprDisplayGlowOverride, ExprDisplayHeightWidth, ExprDisplayInterpolation, ExprDisplayShadow, ExprDisplayTeleportDuration, ExprDisplayTransformationRotation, ExprDisplayTransformationScaleTranslation, ExprDisplayViewRange, ExprEquipCompCameraOverlay, ExprEquipCompEntities, ExprEquipCompEquipSound, ExprEquipCompModel, ExprEquipCompShearSound, ExprEquipCompSlot, ExprEquippableComponent, ExpressionList, ExprFishingApproachAngle, ExprFishingBiteTime, ExprFishingHook, ExprFishingHookEntity, ExprFishingWaitTime, ExprFoodExhaustion, ExprFurnaceEventItems, ExprFurnaceSlot, ExprFurnaceTime, ExprGameEffectWithData, ExprHexCode, ExprInteractionDimensions, ExprItemCompCopy, ExprItemDisplayTransform, ExprItemOfEntity, ExprItemWithLore, ExprJoinMessage, ExprKickMessage, ExprLastInteractionDate, ExprLastInteractionPlayer, ExprLoot, ExprLootContext, ExprLootContextEntity, ExprLootContextLocation, ExprLootContextLooter, ExprLootContextLuck, ExprLootItems, ExprLootTable, ExprLootTableFromString, ExprLootTableSeed, ExprLore, ExprLoveTime, ExprMOTD, ExprOnScreenKickMessage, ExprParticleCount, ExprParticleDistribution, ExprParticleOffset, ExprParticleSpeed, ExprParticleWithData, ExprParticleWithOffset, ExprParticleWithSpeed, ExprPersistentData, ExprPickedItem, ExprPlayerListHeaderFooter, ExprPlayerListName, ExprPotionAmplifier, ExprPotionDuration, ExprPotionEffect, ExprPotionEffects, ExprPotionEffectTypeCategory, ExprQuaternionAxisAngle, ExprQuitMessage, ExprRawString, ExprRecursiveSize, ExprRotate, ExprSecBlankEquipComp, ExprSecCreateLootContext, ExprSecDamageSource, ExprSecPotionEffect, ExprSignText, ExprSkriptPotionEffect, ExprSourceLocation, ExprStringColor, ExprTag, ExprTagContents, ExprTagKey, ExprTagsOf, ExprTagsOfType, ExprTextDisplayAlignment, ExprTextDisplayLineWidth, ExprTextDisplayOpacity, ExprTextOf, ExprWithYawPitch, FunctionReferenceParser.EmptyExpression, LitAt, LitConsole, LitDoubleMaxValue, LitDoubleMinValue, LiteralList, LiteralString, LitEternity, LitFloatMaxValue, LitFloatMinValue, LitInfinity, LitIntMaxValue, LitIntMinValue, LitLongMaxValue, LitLongMinValue, LitNaN, LitNegativeInfinity, LitNewLine, LitPi, PropertyBaseExpression, ch.njol.skript.expressions.base.PropertyExpression, PropExprAmount, PropExprCustomName, PropExprName, PropExprNumber, PropExprScale, PropExprSize, PropExprValueOf, PropExprWXYZ, ch.njol.skript.expressions.base.SectionExpression, SimpleExpression, SimpleLiteral, ch.njol.skript.expressions.base.SimplePropertyExpression, SimplifiedLiteral, UnparsedLiteral, Variable, VariableString
public interface Loopable<T>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the given 'loop-...' expression should match this loop, e.g.iterator(org.bukkit.event.Event event) Returns the same asExpression.getArray(Event)but as an iterator.default booleanChecks whether the expression allows using 'next loop-value' when provided as the iterator for a SecLoop.
-
Method Details
-
iterator
Returns the same asExpression.getArray(Event)but as an iterator. This method should be overridden by expressions intended to be looped to increase performance.- Parameters:
event- The event to be used for evaluation- Returns:
- An iterator to iterate over all values of this expression which may be empty and/or null, but must not return null elements.
- See Also:
-
isLoopOf
Checks whether the given 'loop-...' expression should match this loop, e.g. loop-block matches any loops that loop through blocks and loop-argument matches an argument loop.You should usually just return false as e.g. loop-block will automatically match the expression if its returnType is Block or a subtype of it.
- Parameters:
input- The entered input string (the blank in loop-___)- Returns:
- Whether this loop matches the given string
-
supportsLoopPeeking
default boolean supportsLoopPeeking()Checks whether the expression allows using 'next loop-value' when provided as the iterator for a SecLoop.- Returns:
-