DeployableProjectileShooterComponent class
Пакет: com.hypixel.hytale.builtin.deployables.component
Файл: com/hypixel/hytale/builtin/deployables/component/DeployableProjectileShooterComponent.java
implements: Component<EntityStore>
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
StandardPhysicsProvider |
var3 |
|
Ref |
var6 |
|
DeployableProjectileComponent |
var7 |
Методы (6)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
Ref<EntityStore> |
getActiveTargetRef<EntityStore> getActiveTarget() |
static |
ComponentType<EntityStore, DeployableProjectileShooterComponent> |
getComponentTypeComponentType<EntityStore, DeployableProjectileShooterComponent> getComponentType() |
|
|
if if(var3 != null) |
|
|
if if(var4x != null) |
public |
void |
setActiveTargetvoid setActiveTarget(Ref<EntityStore> var1) |
public |
void |
spawnProjectilevoid spawnProjectile(@Nonnull Ref<EntityStore> var1, @Nonnull CommandBuffer<EntityStore> var2, @Nonnull ProjectileConfig var3, @Nonnull Vector3d var4, @Nonnull Vector3d var5) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.deployables.component;
class="kw">import com.hypixel.hytale.builtin.deployables.DeployablesPlugin;
class="kw">import com.hypixel.hytale.component.CommandBuffer;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.server.core.modules.projectile.ProjectileModule;
class="kw">import com.hypixel.hytale.server.core.modules.projectile.config.ProjectileConfig;
class="kw">import com.hypixel.hytale.server.core.modules.projectile.config.StandardPhysicsProvider;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
class="kw">import java.util.List;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector3d;
class="kw">public class DeployableProjectileShooterComponent class="kw">implements Component<EntityStore> {
@Nonnull
class="kw">protected class="kw">final List<Ref<EntityStore>> projectiles = new ReferenceArrayList();
@Nonnull
class="kw">protected class="kw">final List<Ref<EntityStore>> projectilesForRemoval = new ReferenceArrayList();
class="kw">protected Ref<EntityStore> activeTarget;
class="kw">public DeployableProjectileShooterComponent() {
}
class="kw">public class="kw">static ComponentType<EntityStore, DeployableProjectileShooterComponent> getComponentType() {
class="kw">return DeployablesPlugin.get().getDeployableProjectileShooterComponentType();
}
class="kw">public void spawnProjectile(
@Nonnull Ref<EntityStore> var1, @Nonnull CommandBuffer<EntityStore> var2, @Nonnull ProjectileConfig var3, @Nonnull Vector3d var4, @Nonnull Vector3d var5
) {
Ref var6 = ProjectileModule.get().spawnProjectile(var1, var2, var3, var4, var5);
DeployableProjectileComponent var7 = var2.addComponent(var6, DeployableProjectileComponent.getComponentType());
var7.setPreviousTickPosition(var4);
var2.run(var2x -> {
if (var6.isValid()) {
StandardPhysicsProvider var3 = var2x.getComponent(var6, StandardPhysicsProvider.getComponentType());
if (var3 != null) {
var3.setImpactConsumer((var1x, var2xx, var3x, var4x, var5x, var6x) -> {
if (var4x != null) {
var7.setHitEntityRef(var4x);
}
});
var3.setBounceConsumer(null);
}
}
});
this.projectiles.add(var6);
}
@Nonnull
class="kw">public List<Ref<EntityStore>> getProjectiles() {
class="kw">return this.projectiles;
}
@Nonnull
class="kw">public List<Ref<EntityStore>> getProjectilesForRemoval() {
class="kw">return this.projectilesForRemoval;
}
class="kw">public Ref<EntityStore> getActiveTarget() {
class="kw">return this.activeTarget;
}
class="kw">public void setActiveTarget(Ref<EntityStore> var1) {
this.activeTarget = var1;
}
@Override
class="kw">public Component<EntityStore> clone() {
class="kw">return this;
}
}