AugmentBlocksPlugin class

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

Файл: com/hypixel/hytale/builtin/augmentblocks/AugmentBlocksPlugin.java

extends: JavaPlugin

Поля (2)

МодификаторыТипИмя
static AugmentBlocksPlugin instance
instance

Методы (4)

МодификаторыВозвратСигнатура
static AugmentBlocksPlugin getAugmentBlocksPlugin get()
public ComponentType<ChunkStore, AugmentBlock> getAugmentBlockComponentTypeComponentType<ChunkStore, AugmentBlock> getAugmentBlockComponentType()
public ResourceType<ChunkStore, SpatialResource<Ref<ChunkStore>, ChunkStore>> getSpatialResourceResourceType<ChunkStore, SpatialResource<Ref<ChunkStore>, ChunkStore>> getSpatialResource()
abstract super super(var1)

Исходный код

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

class="kw">import com.hypixel.hytale.builtin.augmentblocks.progression.AugmentProgressionRestoreSystem;
class="kw">import com.hypixel.hytale.builtin.crafting.component.BenchBlock;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.ResourceType;
class="kw">import com.hypixel.hytale.component.spatial.KDTree;
class="kw">import com.hypixel.hytale.component.spatial.SpatialResource;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.Interaction;
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 AugmentBlocksPlugin class="kw">extends JavaPlugin {
   class="kw">private class="kw">static AugmentBlocksPlugin instance;
   class="kw">private ComponentType<ChunkStore, AugmentBlock> augmentableBlockComponentType;
   class="kw">private ResourceType<ChunkStore, SpatialResource<Ref<ChunkStore>, ChunkStore>> spatialResource;

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

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

   @Override
   class="kw">public void setup() {
      instance = this;
      this.augmentableBlockComponentType = this.getChunkStoreRegistry().registerComponent(AugmentBlock.class, "AugmentBlock", AugmentBlock.CODEC);
      this.spatialResource = this.getChunkStoreRegistry().registerSpatialResource(() -> new KDTree<>(Ref::isValid));
      this.getChunkStoreRegistry().registerSystem(new AugmentBlocksSpatialSystem(this.spatialResource));
      BenchBlock.setGrantedAugmentTagsRefresher(AugmentBlocksUtils::syncBenchAugmentTags);
      this.getCodecRegistry(Interaction.CODEC).register("AugmentCondition", AugmentConditionInteraction.class, AugmentConditionInteraction.CODEC);
      this.getChunkStoreRegistry().registerSystem(new AugmentProgressionRestoreSystem(this.augmentableBlockComponentType));
   }

   class="kw">public ComponentType<ChunkStore, AugmentBlock> getAugmentBlockComponentType() {
      class="kw">return this.augmentableBlockComponentType;
   }

   class="kw">public ResourceType<ChunkStore, SpatialResource<Ref<ChunkStore>, ChunkStore>> getSpatialResource() {
      class="kw">return this.spatialResource;
   }
}