DeployablesPlugin class
Пакет: com.hypixel.hytale.builtin.deployables
Файл: com/hypixel/hytale/builtin/deployables/DeployablesPlugin.java
extends: JavaPlugin
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
static |
DeployablesPlugin |
instance |
|
|
instance |
|
ComponentRegistryProxy |
var1 |
Методы (6)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
static |
DeployablesPlugin |
getDeployablesPlugin get() |
public |
ComponentType<EntityStore, DeployableComponent> |
getDeployableComponentTypeComponentType<EntityStore, DeployableComponent> getDeployableComponentType() |
public |
ComponentType<EntityStore, DeployableOwnerComponent> |
getDeployableOwnerComponentTypeComponentType<EntityStore, DeployableOwnerComponent> getDeployableOwnerComponentType() |
public |
ComponentType<EntityStore, DeployableProjectileComponent> |
getDeployableProjectileComponentTypeComponentType<EntityStore, DeployableProjectileComponent> getDeployableProjectileComponentType() |
public |
ComponentType<EntityStore, DeployableProjectileShooterComponent> |
getDeployableProjectileShooterComponentTypeComponentType<EntityStore, DeployableProjectileShooterComponent> getDeployableProjectileShooterComponentType() |
abstract |
|
super super(var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.deployables;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
class="kw">import com.hypixel.hytale.builtin.deployables.component.DeployableComponent;
class="kw">import com.hypixel.hytale.builtin.deployables.component.DeployableOwnerComponent;
class="kw">import com.hypixel.hytale.builtin.deployables.component.DeployableProjectileComponent;
class="kw">import com.hypixel.hytale.builtin.deployables.component.DeployableProjectileShooterComponent;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableAoeConfig;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableConfig;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableSpawner;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableTrapConfig;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableTrapSpawnerConfig;
class="kw">import com.hypixel.hytale.builtin.deployables.config.DeployableTurretConfig;
class="kw">import com.hypixel.hytale.builtin.deployables.interaction.SpawnDeployableAtHitLocationInteraction;
class="kw">import com.hypixel.hytale.builtin.deployables.interaction.SpawnDeployableAtLocationInteraction;
class="kw">import com.hypixel.hytale.builtin.deployables.interaction.SpawnDeployableFromRaycastInteraction;
class="kw">import com.hypixel.hytale.builtin.deployables.system.DeployablesSystem;
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.HytaleAssetStore;
class="kw">import com.hypixel.hytale.server.core.asset.type.entityeffect.config.EntityEffect;
class="kw">import com.hypixel.hytale.server.core.asset.type.model.config.ModelAsset;
class="kw">import com.hypixel.hytale.server.core.asset.type.soundevent.config.SoundEvent;
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.EntityStore;
class="kw">import javax.annotation.Nonnull;
class="kw">public class DeployablesPlugin class="kw">extends JavaPlugin {
class="kw">private class="kw">static DeployablesPlugin instance;
class="kw">private ComponentType<EntityStore, DeployableComponent> deployableComponentType;
class="kw">private ComponentType<EntityStore, DeployableOwnerComponent> deployableOwnerComponentType;
class="kw">private ComponentType<EntityStore, DeployableProjectileShooterComponent> deployableProjectileShooterComponentType;
class="kw">private ComponentType<EntityStore, DeployableProjectileComponent> deployableProjectileComponentType;
class="kw">public DeployablesPlugin(@Nonnull JavaPluginInit var1) {
super(var1);
}
class="kw">public class="kw">static DeployablesPlugin get() {
class="kw">return instance;
}
@Override
class="kw">protected void setup() {
instance = this;
AssetRegistry.register(
((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)((HytaleAssetStore.Builder)HytaleAssetStore.builder(
DeployableSpawner.class, new DefaultAssetMap()
)
.setPath("DeployableSpawners"))
.setCodec(DeployableSpawner.CODEC))
.setKeyFunction(DeployableSpawner::getId))
.loadsAfter(ModelAsset.class, EntityEffect.class, SoundEvent.class))
.loadsBefore(Interaction.class))
.build()
);
ComponentRegistryProxy var1 = this.getEntityStoreRegistry();
this.deployableComponentType = var1.registerComponent(DeployableComponent.class, DeployableComponent::new);
this.deployableOwnerComponentType = var1.registerComponent(DeployableOwnerComponent.class, DeployableOwnerComponent::new);
this.deployableProjectileShooterComponentType = var1.registerComponent(
DeployableProjectileShooterComponent.class, DeployableProjectileShooterComponent::new
);
this.deployableProjectileComponentType = var1.registerComponent(DeployableProjectileComponent.class, DeployableProjectileComponent::new);
DeployableConfig.CODEC.register("Trap", DeployableTrapConfig.class, DeployableTrapConfig.CODEC);
DeployableConfig.CODEC.register("TrapSpawner", DeployableTrapSpawnerConfig.class, DeployableTrapSpawnerConfig.CODEC);
DeployableConfig.CODEC.register("Aoe", DeployableAoeConfig.class, DeployableAoeConfig.CODEC);
DeployableConfig.CODEC.register("Turret", DeployableTurretConfig.class, DeployableTurretConfig.CODEC);
Interaction.CODEC.register("SpawnDeployableAtHitLocation", SpawnDeployableAtHitLocationInteraction.class, SpawnDeployableAtHitLocationInteraction.CODEC);
Interaction.CODEC.register("SpawnDeployableAtLocation", SpawnDeployableAtLocationInteraction.class, SpawnDeployableAtLocationInteraction.CODEC);
Interaction.CODEC.register("SpawnDeployableFromRaycast", SpawnDeployableFromRaycastInteraction.class, SpawnDeployableFromRaycastInteraction.CODEC);
var1.registerSystem(new DeployablesSystem.DeployableTicker());
var1.registerSystem(new DeployablesSystem.DeployableRegisterer());
var1.registerSystem(new DeployablesSystem.DeployableOwnerTicker());
}
class="kw">public ComponentType<EntityStore, DeployableComponent> getDeployableComponentType() {
class="kw">return this.deployableComponentType;
}
class="kw">public ComponentType<EntityStore, DeployableOwnerComponent> getDeployableOwnerComponentType() {
class="kw">return this.deployableOwnerComponentType;
}
class="kw">public ComponentType<EntityStore, DeployableProjectileShooterComponent> getDeployableProjectileShooterComponentType() {
class="kw">return this.deployableProjectileShooterComponentType;
}
class="kw">public ComponentType<EntityStore, DeployableProjectileComponent> getDeployableProjectileComponentType() {
class="kw">return this.deployableProjectileComponentType;
}
}