ReactiveBlocksPlugin class

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

Файл: com/hypixel/hytale/builtin/reactiveblocks/ReactiveBlocksPlugin.java

extends: JavaPlugin

Поля (4)

МодификаторыТипИмя
static ReactiveBlocksPlugin instance
instance
ComponentRegistryProxy var1
ComponentType var2

Методы (3)

МодификаторыВозвратСигнатура
static ReactiveBlocksPlugin getReactiveBlocksPlugin get()
public ComponentType<ChunkStore, BlockExplosive> getExplosiveComponentTypeComponentType<ChunkStore, BlockExplosive> getExplosiveComponentType()
abstract super super(var1)

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.reactiveblocks.states.BlockExplosive;
class="kw">import com.hypixel.hytale.builtin.reactiveblocks.systems.ExplosiveSystems;
class="kw">import com.hypixel.hytale.component.ComponentRegistryProxy;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.server.core.modules.block.BlockModule;
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.ChunkStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class ReactiveBlocksPlugin class="kw">extends JavaPlugin {
   class="kw">protected class="kw">static ReactiveBlocksPlugin instance;
   class="kw">private ComponentType<ChunkStore, BlockExplosive> explosiveComponentType;

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

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

   @Override
   class="kw">protected void setup() {
      ComponentRegistryProxy var1 = this.getChunkStoreRegistry();
      ComponentType var2 = BlockModule.BlockStateInfo.getComponentType();
      this.explosiveComponentType = var1.registerComponent(BlockExplosive.class, "BlockExplosive", BlockExplosive.CODEC);
      var1.registerSystem(new ExplosiveSystems.OnExplosiveAdded(var2));
      var1.registerSystem(new ExplosiveSystems.Ticking());
   }

   class="kw">public ComponentType<ChunkStore, BlockExplosive> getExplosiveComponentType() {
      class="kw">return this.explosiveComponentType;
   }
}