Class AbstractScriptNode
java.lang.Object
com.soulfiremc.server.script.AbstractScriptNode
- All Implemented Interfaces:
ScriptNode
- Direct Known Subclasses:
AbsNode, AddNode, AndNode, AttackNode, Base64DecodeNode, Base64EncodeNode, BooleanConstantNode, BranchNode, BreakBlockNode, BSplineNode, CacheNode, CeilNode, ClampNode, CompareNode, CompressionNode, ConcatNode, CosNode, CreateVector3Node, DebounceNode, DecryptNode, DiscordWebhookNode, DistanceNode, DivideNode, EncryptNode, EndsWithNode, FilterBotsNode, FindBlockNode, FindEntityNode, FirstNode, FloorNode, ForEachBotNode, ForEachNode, FormatNode, FormulaNode, GateNode, GetArmorNode, GetAtNode, GetBiomeNode, GetBlockNode, GetBotByNameNode, GetBotInfoNode, GetBotsNode, GetBotStateNode, GetDimensionNode, GetEffectsNode, GetExperienceNode, GetGamemodeNode, GetHealthNode, GetHungerNode, GetInventoryNode, GetLightLevelNode, GetPersistentBotVariableNode, GetPositionNode, GetRotationNode, GetSelectedSlotNode, GetSessionBotVariableNode, GetTargetBlockNode, GetTimeNode, GetVelocityNode, GetWeatherNode, HashNode, IndexOfNode, IsEmptyNode, IsNullNode, JoinToStringNode, JsonArrayNode, JsonGetNode, JsonObjectNode, JsonParseNode, JsonSetNode, JsonStringifyNode, JumpNode, LastNode, LerpNode, ListContainsNode, ListLengthNode, LLMChatNode, LookAtNode, LoopNode, MaxNode, MinNode, ModuloNode, MultiplyNode, NotNode, NumberConstantNode, OnBotInitNode, OnChatNode, OnDamageNode, OnDeathNode, OnIntervalNode, OnJoinNode, OnScriptEndNode, OnScriptInitNode, OnTickNode, OrNode, PathfindToNode, PlaceBlockNode, PowNode, PrintNode, RandomNode, RangeNode, RateLimitNode, RegexMatchNode, RegexReplaceNode, ReplaceNode, RoundNode, SelectSlotNode, SendChatNode, SequenceNode, SetPersistentBotVariableNode, SetRotationNode, SetSessionBotVariableNode, SinNode, SneakNode, SplitNode, SplitVector3Node, SprintNode, SqrtNode, StartsWithNode, StateNode, StringConstantNode, StringContainsNode, StringLengthNode, SubstringNode, SubtractNode, SwitchNode, TanNode, TimestampNode, ToLowerCaseNode, ToNumberNode, ToStringNode, ToUpperCaseNode, TrimNode, UseItemNode, Vector3ConstantNode, WaitNode, WebFetchNode, XorNode
Abstract base class for script nodes providing common utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHelper method to create a completed Mono with empty results.completedMono(Map<String, NodeValue> results) Helper method to create a completed Mono with results.delayedEmptyMono(Duration delay) Helper method to create a delayed Mono with empty results.delayedMono(Duration delay, Map<String, NodeValue> results) Helper method to create a delayed Mono with results.Helper method to create an empty result.protected booleangetBooleanInput(Map<String, NodeValue> inputs, String name, boolean defaultValue) Helper method to get a boolean input value.protected @Nullable BotConnectiongetBotInput(Map<String, NodeValue> inputs) Helper method to get a bot from inputs.protected doublegetDoubleInput(Map<String, NodeValue> inputs, String name, double defaultValue) Helper method to get a double input value.protected floatgetFloatInput(Map<String, NodeValue> inputs, String name, float defaultValue) Helper method to get a float input value.protected <T> THelper method to get an input value with type casting.protected intgetIntInput(Map<String, NodeValue> inputs, String name, int defaultValue) Helper method to get an int input value.protected @Nullable com.google.gson.JsonElementgetJsonInput(Map<String, NodeValue> inputs, String name) Helper method to get a raw JsonElement from inputs.getListInput(Map<String, NodeValue> inputs, String name) Helper method to get a list input value as NodeValues.protected longgetLongInput(Map<String, NodeValue> inputs, String name, long defaultValue) Helper method to get a long input value.protected StringHelper method to get a string input value.getStringListInput(Map<String, NodeValue> inputs, String name) Helper method to get a list of strings.protected BotConnectionrequireBot(Map<String, NodeValue> inputs) Helper method to require a bot from inputs.Helper method to create a result map with a single value.Helper method to create a result map with multiple values.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ScriptNode
executeReactive
-
Constructor Details
-
AbstractScriptNode
public AbstractScriptNode()
-
-
Method Details
-
getInput
-
getDoubleInput
-
getIntInput
-
getLongInput
-
getFloatInput
-
getBooleanInput
-
getStringInput
-
getListInput
-
getStringListInput
-
getBotInput
Helper method to get a bot from inputs. Returns null if the "bot" input is not set.- Parameters:
inputs- the node inputs- Returns:
- the bot connection, or null if not provided
-
requireBot
Helper method to require a bot from inputs. The bot is typically provided automatically via the execution context from an upstream trigger node or ForEachBot node.- Parameters:
inputs- the node inputs (includes execution context values)- Returns:
- the bot connection
- Throws:
IllegalStateException- if no bot is available
-
getJsonInput
-
result
-
results
-
emptyResult
-
completedMono
-
completedEmptyMono
-
delayedMono
-
delayedEmptyMono
-