StartVoidEventInFragmentSystem class

Пакет: com.hypixel.hytale.builtin.portals.systems.voidevent

Файл: com/hypixel/hytale/builtin/portals/systems/voidevent/StartVoidEventInFragmentSystem.java

extends: DelayedSystem<EntityStore>

Поля (11)

МодификаторыТипИмя
Ref var10
boolean var11
boolean var12
Holder var13
Ref var14
PortalWorld var4
World var5
VoidEventConfig var6
int var7
int var8
int var9

Методы (3)

МодификаторыВозвратСигнатура
if if(var11 && !var12)
if if(var12 && !var11)
abstract super super(1.0F)

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.portals.components.voidevent.VoidEvent;
class="kw">import com.hypixel.hytale.builtin.portals.components.voidevent.config.VoidEventConfig;
class="kw">import com.hypixel.hytale.builtin.portals.resources.PortalWorld;
class="kw">import com.hypixel.hytale.component.AddReason;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.RemoveReason;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.component.system.DelayedSystem;
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 StartVoidEventInFragmentSystem class="kw">extends DelayedSystem<EntityStore> {
   class="kw">public StartVoidEventInFragmentSystem() {
      super(1.0F);
   }

   @Override
   class="kw">public void delayedTick(float var1, int var2, @Nonnull Store<EntityStore> var3) {
      PortalWorld var4 = var3.getResource(PortalWorld.getResourceType());
      if (var4.exists()) {
         if (var4.getPortalType().isVoidInvasionEnabled()) {
            World var5 = var3.getExternalData().getWorld();
            VoidEventConfig var6 = var4.getVoidEventConfig();
            int var7 = var4.getTimeLimitSeconds();
            int var8 = var6.getShouldStartAfterSeconds(var7);
            int var9 = (int)Math.ceil(var4.getElapsedSeconds(var5));
            Ref var10 = var4.getVoidEventRef();
            boolean var11 = var10 != null && var10.isValid();
            boolean var12 = var9 >= var8;
            if (var11 && !var12) {
               var3.removeEntity(var10, RemoveReason.REMOVE);
            }

            if (var12 && !var11) {
               Holder var13 = EntityStore.REGISTRY.newHolder();
               var13.addComponent(VoidEvent.getComponentType(), new VoidEvent());
               Ref var14 = var3.addEntity(var13, AddReason.SPAWN);
               var4.setVoidEventRef(var14);
            }
         }
      }
   }
}