WeatherPlugin class
Пакет: com.hypixel.hytale.builtin.weather
Файл: com/hypixel/hytale/builtin/weather/WeatherPlugin.java
extends: JavaPlugin
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
static |
WeatherPlugin |
instance |
|
|
instance |
|
ComponentRegistryProxy |
var1 |
Методы (2)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
static |
WeatherPlugin |
getWeatherPlugin get() |
abstract |
|
super super(var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.weather;
class="kw">import com.hypixel.hytale.builtin.weather.commands.WeatherCommand;
class="kw">import com.hypixel.hytale.builtin.weather.components.WeatherTracker;
class="kw">import com.hypixel.hytale.builtin.weather.resources.WeatherResource;
class="kw">import com.hypixel.hytale.builtin.weather.systems.WeatherSystem;
class="kw">import com.hypixel.hytale.component.ComponentRegistryProxy;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.ResourceType;
class="kw">import com.hypixel.hytale.server.core.command.system.CommandManager;
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 WeatherPlugin class="kw">extends JavaPlugin {
class="kw">private class="kw">static WeatherPlugin instance;
class="kw">private ComponentType<EntityStore, WeatherTracker> weatherTrackerComponentType;
class="kw">private ResourceType<EntityStore, WeatherResource> weatherResourceType;
class="kw">public class="kw">static WeatherPlugin get() {
class="kw">return instance;
}
class="kw">public WeatherPlugin(@Nonnull JavaPluginInit var1) {
super(var1);
instance = this;
}
@Override
class="kw">protected void setup() {
ComponentRegistryProxy var1 = this.getEntityStoreRegistry();
this.weatherResourceType = EntityStore.REGISTRY.registerResource(WeatherResource.class, WeatherResource::new);
this.weatherTrackerComponentType = EntityStore.REGISTRY.registerComponent(WeatherTracker.class, WeatherTracker::new);
var1.registerSystem(new WeatherSystem.WorldAddedSystem());
var1.registerSystem(new WeatherSystem.PlayerAddedSystem());
var1.registerSystem(new WeatherSystem.TickingSystem());
var1.registerSystem(new WeatherSystem.InvalidateWeatherAfterTeleport());
CommandManager.get().registerSystemCommand(new WeatherCommand());
}
@Nonnull
class="kw">public ComponentType<EntityStore, WeatherTracker> getWeatherTrackerComponentType() {
class="kw">return this.weatherTrackerComponentType;
}
@Nonnull
class="kw">public ResourceType<EntityStore, WeatherResource> getWeatherResourceType() {
class="kw">return this.weatherResourceType;
}
}