Teleport class
Пакет: com.hypixel.hytale.server.core.modules.entity.teleport
Файл: com/hypixel/hytale/server/core/modules/entity/teleport/Teleport.java
implements: Component<EntityStore>
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
Rotation3f |
var2 |
|
Rotation3f |
var3 |
|
Rotation3f |
var3 |
Методы (8)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
return |
createForPlayerreturn createForPlayer(null, var0, var1) |
abstract |
return |
createForPlayerreturn createForPlayer(null, var0) |
public |
CompletableFuture<Void> |
getOnCompleteCompletableFuture<Void> getOnComplete() |
|
|
if if(this.headRotation == null) |
public |
boolean |
isResetVelocityboolean isResetVelocity() |
public |
void |
setOnCompletevoid setOnComplete(@Nonnull CompletableFuture<Void> var1) |
public |
void |
setPositionvoid setPosition(@Nonnull Vector3dc var1) |
public |
void |
setRotationvoid setRotation(@Nonnull Rotation3fc var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.entity.teleport;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.math.vector.Rotation3f;
class="kw">import com.hypixel.hytale.math.vector.Rotation3fc;
class="kw">import com.hypixel.hytale.math.vector.Transform;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.util.concurrent.CompletableFuture;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3d;
class="kw">import org.joml.Vector3dc;
class="kw">public class Teleport class="kw">implements Component<EntityStore> {
@Nullable
class="kw">private class="kw">final World world;
@Nonnull
class="kw">private class="kw">final Vector3d position = new Vector3d();
@Nonnull
class="kw">private class="kw">final Rotation3f rotation = new Rotation3f();
@Nullable
class="kw">private Rotation3f headRotation;
class="kw">private boolean resetVelocity = true;
class="kw">private CompletableFuture<Void> onComplete;
@Nonnull
class="kw">public class="kw">static ComponentType<EntityStore, Teleport> getComponentType() {
class="kw">return EntityModule.get().getTeleportComponentType();
}
class="kw">public Teleport(@Nullable World var1, @Nonnull Vector3dc var2, @Nonnull Rotation3fc var3) {
this.world = var1;
this.position.set(var2);
this.rotation.set(var3);
}
class="kw">public Teleport(@Nonnull Vector3dc var1, @Nonnull Rotation3fc var2) {
this.world = null;
this.position.set(var1);
this.rotation.set(var2);
}
class="kw">public Teleport(@Nonnull Teleport var1) {
this.world = var1.world;
this.position.set(var1.position);
this.rotation.set(var1.rotation);
this.headRotation = var1.headRotation == null ? null : new Rotation3f(var1.headRotation);
this.resetVelocity = var1.resetVelocity;
}
@Nonnull
class="kw">public class="kw">static Teleport createForPlayer(@Nullable World var0, @Nonnull Transform var1) {
Rotation3f var2 = var1.getRotation();
Rotation3f var3 = new Rotation3f(0.0F, var2.yaw(), 0.0F);
class="kw">return new Teleport(var0, var1.getPosition(), var3).setHeadRotation(var2);
}
@Nonnull
class="kw">public class="kw">static Teleport createForPlayer(@Nullable World var0, @Nonnull Vector3dc var1, @Nonnull Rotation3fc var2) {
Rotation3f var3 = new Rotation3f(0.0F, var2.yaw(), 0.0F);
class="kw">return new Teleport(var0, var1, var3).setHeadRotation(var2);
}
@Nonnull
class="kw">public class="kw">static Teleport createForPlayer(@Nonnull Vector3dc var0, @Nonnull Rotation3fc var1) {
class="kw">return createForPlayer(null, var0, var1);
}
@Nonnull
class="kw">public class="kw">static Teleport createForPlayer(@Nonnull Transform var0) {
class="kw">return createForPlayer(null, var0);
}
@Nonnull
class="kw">public class="kw">static Teleport createExact(@Nonnull Vector3dc var0, @Nonnull Rotation3fc var1, @Nonnull Rotation3fc var2) {
class="kw">return new Teleport(var0, var1).setHeadRotation(var2);
}
@Nonnull
class="kw">public class="kw">static Teleport createExact(@Nonnull Vector3dc var0, @Nonnull Rotation3fc var1) {
class="kw">return new Teleport(var0, var1);
}
class="kw">public void setPosition(@Nonnull Vector3dc var1) {
this.position.set(var1);
}
class="kw">public void setRotation(@Nonnull Rotation3fc var1) {
this.rotation.set(var1);
}
@Nonnull
class="kw">public Teleport setHeadRotation(@Nonnull Rotation3fc var1) {
if (this.headRotation == null) {
this.headRotation = new Rotation3f(var1);
} else {
this.headRotation.set(var1);
}
class="kw">return this;
}
@Nonnull
class="kw">public Teleport withoutVelocityReset() {
this.resetVelocity = false;
class="kw">return this;
}
class="kw">public void setOnComplete(@Nonnull CompletableFuture<Void> var1) {
this.onComplete = var1;
}
class="kw">public CompletableFuture<Void> getOnComplete() {
class="kw">return this.onComplete;
}
@Nullable
class="kw">public World getWorld() {
class="kw">return this.world;
}
@Nonnull
class="kw">public Vector3d getPosition() {
class="kw">return this.position;
}
@Nonnull
class="kw">public Rotation3f getRotation() {
class="kw">return this.rotation;
}
@Nullable
class="kw">public Rotation3f getHeadRotation() {
class="kw">return this.headRotation;
}
class="kw">public boolean isResetVelocity() {
class="kw">return this.resetVelocity;
}
@Nonnull
class="kw">public Teleport clone() {
class="kw">return new Teleport(this);
}
}