JumpIfStringMatchOperation class

Пакет: com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.sequential.flowcontrol

Файл: com/hypixel/hytale/builtin/buildertools/scriptedbrushes/operations/sequential/flowcontrol/JumpIfStringMatchOperation.java

extends: SequenceBrushOperation

Поля (1)

МодификаторыТипИмя
final BuilderCodec<JumpIfStringMatchOperation> CODEC

Методы (1)

МодификаторыВозвратСигнатура
abstract super super("Jump If String Matches", "Jump the execution of the stack to the stored point if a string matches, useful for macro commands.", false)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.sequential.flowcontrol;

class="kw">import com.hypixel.hytale.builtin.buildertools.scriptedbrushes.BrushConfig;
class="kw">import com.hypixel.hytale.builtin.buildertools.scriptedbrushes.BrushConfigCommandExecutor;
class="kw">import com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.system.SequenceBrushOperation;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class JumpIfStringMatchOperation class="kw">extends SequenceBrushOperation {
   class="kw">public class="kw">static class="kw">final BuilderCodec<JumpIfStringMatchOperation> CODEC = BuilderCodec.builder(JumpIfStringMatchOperation.class, JumpIfStringMatchOperation::new)
      .append(new KeyedCodec<>("StoredIndexName", Codec.STRING), (var0, var1) -> var0.indexVariableNameArg = var1, var0 -> var0.indexVariableNameArg)
      .documentation("The labeled index to jump to, previous or future")
      .add()
      .<String>append(new KeyedCodec<>("LeftSideOfStatement", Codec.STRING), (var0, var1) -> var0.sideOneArg = var1, var0 -> var0.sideOneArg)
      .documentation("The left side of the statement for checking case-insensitive equals")
      .add()
      .<String>append(new KeyedCodec<>("RightSideOfStatement", Codec.STRING), (var0, var1) -> var0.sideTwoArg = var1, var0 -> var0.sideTwoArg)
      .documentation("The right side of the statement for checking case-insensitive equals")
      .add()
      .documentation("Jump the execution of the stack to the stored point if a string matches, useful for macro commands.")
      .build();
   @Nonnull
   class="kw">public String indexVariableNameArg = "Undefined";
   @Nonnull
   class="kw">public String sideOneArg = "Undefined";
   @Nonnull
   class="kw">public String sideTwoArg = "Undefined";

   class="kw">public JumpIfStringMatchOperation() {
      super("Jump If String Matches", "Jump the execution of the stack to the stored point if a string matches, useful for macro commands.", false);
   }

   @Override
   class="kw">public void modifyBrushConfig(
      @Nonnull Ref<EntityStore> var1, @Nonnull BrushConfig var2, @Nonnull BrushConfigCommandExecutor var3, @Nonnull ComponentAccessor<EntityStore> var4
   ) {
      if (this.sideOneArg.equalsIgnoreCase(this.sideTwoArg)) {
         var3.loadOperatingIndex(this.indexVariableNameArg);
      }
   }
}