ActionResetInstructions class

Пакет: com.hypixel.hytale.server.npc.corecomponents.utility

Файл: com/hypixel/hytale/server/npc/corecomponents/utility/ActionResetInstructions.java

extends: ActionBase

Поля (2)

МодификаторыТипИмя
final int[] instructions
IndexedInstructions var2

Методы (5)

МодификаторыВозвратСигнатура
for for(int var6 : this.instructions)
if if(var2 == null)
if if(this.instructions.length == 0)
protected boolean resetInstructionsboolean resetInstructions(@Nonnull ExecutionSupport var1)
abstract super super(var1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.npc.corecomponents.utility;

class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import com.hypixel.hytale.server.npc.asset.builder.BuilderSupport;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.ActionBase;
class="kw">import com.hypixel.hytale.server.npc.corecomponents.utility.builders.BuilderActionResetInstructions;
class="kw">import com.hypixel.hytale.server.npc.instructions.ExecutionSupport;
class="kw">import com.hypixel.hytale.server.npc.instructions.IndexedInstructions;
class="kw">import com.hypixel.hytale.server.npc.sensorinfo.InfoProvider;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class ActionResetInstructions class="kw">extends ActionBase {
   class="kw">protected class="kw">final int[] instructions;

   class="kw">public ActionResetInstructions(@Nonnull BuilderActionResetInstructions var1, @Nonnull BuilderSupport var2) {
      super(var1);
      this.instructions = var1.getInstructions(var2);
   }

   @Override
   class="kw">public boolean execute(
      @Nonnull Ref<EntityStore> var1, @Nonnull ExecutionSupport var2, @Nullable InfoProvider var3, double var4, @Nonnull Store<EntityStore> var6
   ) {
      super.execute(var1, var2, var3, var4, var6);
      var2.getEntitySupport().addDeferredAction((var1x, var2x, var3x, var5) -> this.resetInstructions(var2x));
      class="kw">return true;
   }

   class="kw">protected boolean resetInstructions(@Nonnull ExecutionSupport var1) {
      IndexedInstructions var2 = var1.getIndexedInstructions();
      if (var2 == null) {
         class="kw">return true;
      }

      if (this.instructions.length == 0) {
         var2.resetAll();
         class="kw">return true;
      }

      for (int var6 : this.instructions) {
         var2.reset(var6);
      }

      class="kw">return true;
   }
}