EntitySnapshotHistoryCommand class

Пакет: com.hypixel.hytale.server.core.command.commands.world.entity.snapshot

Файл: com/hypixel/hytale/server/core/command/commands/world/entity/snapshot/EntitySnapshotHistoryCommand.java

extends: AbstractWorldCommand

Поля (6)

МодификаторыТипИмя
ComponentType var4
SnapshotBuffer var4
EntitySnapshot var6
Vector3d var7
SpatialResource var8
List var9

Методы (3)

МодификаторыВозвратСигнатура
abstract for for(int var3 = 0; var3 < var1x.size()
abstract for for(int var5 = var4.getOldestTickIndex()
abstract super super("history", "server.commands.entity.snapshot.history.desc")

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.command.commands.world.entity.snapshot;

class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.component.spatial.SpatialResource;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandContext;
class="kw">import com.hypixel.hytale.server.core.command.system.basecommands.AbstractWorldCommand;
class="kw">import com.hypixel.hytale.server.core.entity.EntitySnapshot;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.SnapshotBuffer;
class="kw">import com.hypixel.hytale.server.core.universe.world.ParticleUtil;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.List;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector3d;

class="kw">public class EntitySnapshotHistoryCommand class="kw">extends AbstractWorldCommand {
   class="kw">public EntitySnapshotHistoryCommand() {
      super("history", "server.commands.entity.snapshot.history.desc");
   }

   @Override
   class="kw">protected void execute(@Nonnull CommandContext var1, @Nonnull World var2, @Nonnull Store<EntityStore> var3) {
      ComponentType var4 = SnapshotBuffer.getComponentType();
      var3.forEachChunk(var4, (var1x, var2x) -> {
         for (int var3 = 0; var3 < var1x.size(); var3++) {
            SnapshotBuffer var4 = var1x.getComponent(var3, var4);
            assert var4 != null;
            if (var4.isInitialized()) {
               for (int var5 = var4.getOldestTickIndex(); var5 <= var4.getCurrentTickIndex(); var5++) {
                  EntitySnapshot var6 = var4.getSnapshot(var5);
                  assert var6 != null;
                  Vector3d var7 = var6.getPosition();
                  SpatialResource var8 = var2x.getResource(EntityModule.get().getPlayerSpatialResourceType());
                  List var9 = SpatialResource.getThreadLocalReferenceList();
                  var8.getSpatialStructure().collect(var7, 75.0, var9);
                  ParticleUtil.spawnParticleEffect("Example_Simple", var7.x, var7.y, var7.z, var9, var2x);
               }
            }
         }
      });
   }
}