FallingBlocksPlugin class

Пакет: com.hypixel.hytale.builtin.fallingblocks

Файл: com/hypixel/hytale/builtin/fallingblocks/FallingBlocksPlugin.java

extends: JavaPlugin

Поля (8)

МодификаторыТипИмя
static FallingBlocksPlugin instance
instance
ComponentRegistryProxy var1
ComponentType var2
ComponentType var3
ComponentType var4
ComponentType var5
ComponentType var6

Методы (3)

МодификаторыВозвратСигнатура
static FallingBlocksPlugin getFallingBlocksPlugin get()
public ComponentType<EntityStore, FallingBlock> getFallingBlockComponentTypeComponentType<EntityStore, FallingBlock> getFallingBlockComponentType()
abstract super super(var1)

Исходный код

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

class="kw">import com.hypixel.hytale.codec.lookup.Priority;
class="kw">import com.hypixel.hytale.component.ComponentRegistryProxy;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.fallingblocks.FallingBlockImpact;
class="kw">import com.hypixel.hytale.server.core.entity.entities.BlockEntity;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.BoundingBox;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
class="kw">import com.hypixel.hytale.server.core.modules.physics.component.PhysicsValues;
class="kw">import com.hypixel.hytale.server.core.modules.physics.component.Velocity;
class="kw">import com.hypixel.hytale.server.core.plugin.JavaPlugin;
class="kw">import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class FallingBlocksPlugin class="kw">extends JavaPlugin {
   class="kw">private class="kw">static FallingBlocksPlugin instance;
   class="kw">private ComponentType<EntityStore, FallingBlock> fallingBlockComponentType;

   class="kw">public class="kw">static FallingBlocksPlugin get() {
      class="kw">return instance;
   }

   class="kw">public FallingBlocksPlugin(@Nonnull JavaPluginInit var1) {
      super(var1);
      instance = this;
   }

   @Override
   class="kw">protected void setup() {
      ComponentRegistryProxy var1 = this.getEntityStoreRegistry();
      this.fallingBlockComponentType = var1.registerComponent(FallingBlock.class, "FallingBlock", FallingBlock.CODEC);
      ComponentType var2 = TransformComponent.getComponentType();
      ComponentType var3 = Velocity.getComponentType();
      ComponentType var4 = PhysicsValues.getComponentType();
      ComponentType var5 = EntityModule.get().getBoundingBoxComponentType();
      ComponentType var6 = BlockEntity.getComponentType();
      var1.registerSystem(new FallingBlockTickingSystem(this.fallingBlockComponentType, var2, var3, var4, var5, var6));
      FallingBlockImpact.CODEC.register(Priority.DEFAULT, "Place", PlaceFallingBlockImpact.class, PlaceFallingBlockImpact.CODEC);
      FallingBlockImpact.CODEC.register("Break", BreakFallingBlockImpact.class, BreakFallingBlockImpact.CODEC);
      FallingBlockImpact.CODEC.register("Explode", ExplodeFallingBlockImpact.class, ExplodeFallingBlockImpact.CODEC);
   }

   class="kw">public ComponentType<EntityStore, FallingBlock> getFallingBlockComponentType() {
      class="kw">return this.fallingBlockComponentType;
   }
}