EntityRemoveSnapshot class

Пакет: com.hypixel.hytale.builtin.buildertools.snapshot

Файл: com/hypixel/hytale/builtin/buildertools/snapshot/EntityRemoveSnapshot.java

implements: EntitySnapshot<EntityAddSnapshot>

Поля (1)

МодификаторыТипИмя
Ref var4

Методы (2)

МодификаторыВозвратСигнатура
abstract return new EntityAddSnapshotreturn new EntityAddSnapshot(var4)
public EntityAddSnapshot restoreEntityEntityAddSnapshot restoreEntity(@Nonnull PlayerRef var1, @Nonnull World var2, @Nonnull ComponentAccessor<EntityStore> var3)

Исходный код

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

class="kw">import com.hypixel.hytale.component.AddReason;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
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 javax.annotation.Nonnull;

class="kw">public class EntityRemoveSnapshot class="kw">implements EntitySnapshot<EntityAddSnapshot> {
   @Nonnull
   class="kw">private class="kw">final Ref<EntityStore> originalRef;
   @Nonnull
   class="kw">private class="kw">final Holder<EntityStore> holder;

   class="kw">public EntityRemoveSnapshot(@Nonnull Ref<EntityStore> var1) {
      this.originalRef = var1;
      this.holder = var1.getStore().copyEntity(var1);
   }

   @Nonnull
   class="kw">public Ref<EntityStore> getOriginalRef() {
      class="kw">return this.originalRef;
   }

   @Nonnull
   class="kw">public Holder<EntityStore> getHolder() {
      class="kw">return this.holder;
   }

   class="kw">public EntityAddSnapshot restoreEntity(@Nonnull PlayerRef var1, @Nonnull World var2, @Nonnull ComponentAccessor<EntityStore> var3) {
      Ref var4 = var3.addEntity(this.holder, AddReason.LOAD);
      class="kw">return new EntityAddSnapshot(var4);
   }
}