PlayerInput class
Пакет: com.hypixel.hytale.server.core.modules.entity.player
Файл: com/hypixel/hytale/server/core/modules/entity/player/PlayerInput.java
implements: Component<EntityStore>
Поля (21)
| Модификаторы | Тип | Имя |
|---|---|---|
|
PlayerInput |
var1 |
|
Ref |
var4 |
|
Ref |
var4 |
|
TransformComponent |
var4 |
|
Velocity |
var4 |
|
HeadRotation |
var4 |
|
MovementStatesComponent |
var4 |
|
Player |
var5 |
|
Player |
var5 |
|
TransformComponent |
var6 |
|
Vector3d |
var7 |
|
private final Vector3d |
velocity |
|
private double |
x |
|
private double |
x |
|
private double |
x |
|
private double |
y |
|
private double |
y |
|
private double |
y |
|
private double |
z |
|
private double |
z |
|
private double |
z |
Методы (51)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public |
AbsoluteMovementpublic AbsoluteMovement(double var1, double var3, double var5) |
|
public |
RelativeMovementpublic RelativeMovement(double var1, double var3, double var5) |
|
public |
SetClientVelocitypublic SetClientVelocity(com.hypixel.hytale.protocol.Vector3d var1) |
|
public |
SetClientVelocitypublic SetClientVelocity(Vector3d var1) |
|
public |
WishMovementpublic WishMovement(double var1, double var3, double var5) |
|
public void |
applypublic void apply(@Nonnull CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(@Nonnull CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3) |
|
public void |
applypublic void apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3) |
abstract |
void |
applyvoid apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3) |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
|
public PlayerInput.InputUpdate |
clonepublic PlayerInput.InputUpdate clone() |
abstract |
PlayerInput.InputUpdate |
clonePlayerInput.InputUpdate clone() |
|
|
for for(PlayerInput.InputUpdate var3 : this.inputUpdateQueue) |
static |
ComponentType<EntityStore, PlayerInput> |
getComponentTypeComponentType<EntityStore, PlayerInput> getComponentType() |
public |
int |
getMountIdint getMountId() |
|
public Vector3d |
getVelocitypublic Vector3d getVelocity() |
|
public double |
getXpublic double getX() |
|
public double |
getXpublic double getX() |
|
public double |
getXpublic double getX() |
|
public double |
getYpublic double getY() |
|
public double |
getYpublic double getY() |
|
public double |
getYpublic double getY() |
|
public double |
getZpublic double getZ() |
|
public double |
getZpublic double getZ() |
|
public double |
getZpublic double getZ() |
|
|
if if(var4 != null) |
|
|
if if(var4 != null) |
|
|
if if(var4 != null) |
|
|
if if(var4 != null) |
public |
void |
queuevoid queue(PlayerInput.InputUpdate var1) |
public |
void |
setMountIdvoid setMountId(int var1) |
|
public void |
setXpublic void setX(double var1) |
|
public void |
setXpublic void setX(double var1) |
|
public void |
setXpublic void setX(double var1) |
|
public void |
setYpublic void setY(double var1) |
|
public void |
setYpublic void setY(double var1) |
|
public void |
setYpublic void setY(double var1) |
|
public void |
setZpublic void setZ(double var1) |
|
public void |
setZpublic void setZ(double var1) |
|
public void |
setZpublic void setZ(double var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.entity.player;
class="kw">import com.hypixel.hytale.component.ArchetypeChunk;
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.protocol.Direction;
class="kw">import com.hypixel.hytale.protocol.MovementStates;
class="kw">import com.hypixel.hytale.server.core.entity.entities.Player;
class="kw">import com.hypixel.hytale.server.core.entity.movement.MovementStatesComponent;
class="kw">import com.hypixel.hytale.server.core.modules.entity.EntityModule;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.HeadRotation;
class="kw">import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
class="kw">import com.hypixel.hytale.server.core.modules.physics.component.Velocity;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import it.unimi.dsi.fastutil.objects.ObjectArrayList;
class="kw">import java.util.List;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector3d;
class="kw">public class PlayerInput class="kw">implements Component<EntityStore> {
@Nonnull
class="kw">private class="kw">final List<PlayerInput.InputUpdate> inputUpdateQueue = new ObjectArrayList();
class="kw">private int mountId;
class="kw">public PlayerInput() {
}
class="kw">public class="kw">static ComponentType<EntityStore, PlayerInput> getComponentType() {
class="kw">return EntityModule.get().getPlayerInputComponentType();
}
class="kw">public void queue(PlayerInput.InputUpdate var1) {
this.inputUpdateQueue.add(var1);
}
@Nonnull
class="kw">public List<PlayerInput.InputUpdate> getMovementUpdateQueue() {
class="kw">return this.inputUpdateQueue;
}
class="kw">public int getMountId() {
class="kw">return this.mountId;
}
class="kw">public void setMountId(int var1) {
this.mountId = var1;
}
@Nonnull
@Override
class="kw">public Component<EntityStore> clone() {
PlayerInput var1 = new PlayerInput();
for (PlayerInput.InputUpdate var3 : this.inputUpdateQueue) {
var1.inputUpdateQueue.add(var3.clone());
}
var1.mountId = this.mountId;
class="kw">return var1;
}
class="kw">public class="kw">static class AbsoluteMovement class="kw">implements PlayerInput.InputUpdate {
class="kw">private double x;
class="kw">private double y;
class="kw">private double z;
class="kw">public AbsoluteMovement(double var1, double var3, double var5) {
this.x = var1;
this.y = var3;
this.z = var5;
}
class="kw">public double getX() {
class="kw">return this.x;
}
class="kw">public void setX(double var1) {
this.x = var1;
}
class="kw">public double getY() {
class="kw">return this.y;
}
class="kw">public void setY(double var1) {
this.y = var1;
}
class="kw">public double getZ() {
class="kw">return this.z;
}
class="kw">public void setZ(double var1) {
this.z = var1;
}
@Override
class="kw">public void apply(@Nonnull CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
Ref var4 = var2.getReferenceTo(var3);
Player var5 = var2.getComponent(var3, Player.getComponentType());
assert var5 != null;
var5.moveTo(var4, this.x, this.y, this.z, var1);
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.AbsoluteMovement(this.x, this.y, this.z);
}
}
class="kw">public class="kw">interface InputUpdate {
void apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3);
PlayerInput.InputUpdate clone();
}
class="kw">public class="kw">static class RelativeMovement class="kw">implements PlayerInput.InputUpdate {
class="kw">private double x;
class="kw">private double y;
class="kw">private double z;
class="kw">public RelativeMovement(double var1, double var3, double var5) {
this.x = var1;
this.y = var3;
this.z = var5;
}
class="kw">public double getX() {
class="kw">return this.x;
}
class="kw">public void setX(double var1) {
this.x = var1;
}
class="kw">public double getY() {
class="kw">return this.y;
}
class="kw">public void setY(double var1) {
this.y = var1;
}
class="kw">public double getZ() {
class="kw">return this.z;
}
class="kw">public void setZ(double var1) {
this.z = var1;
}
@Override
class="kw">public void apply(@Nonnull CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
Ref var4 = var2.getReferenceTo(var3);
Player var5 = var2.getComponent(var3, Player.getComponentType());
assert var5 != null;
TransformComponent var6 = var2.getComponent(var3, TransformComponent.getComponentType());
assert var6 != null;
Vector3d var7 = var6.getPosition();
var5.moveTo(var4, var7.x + this.x, var7.y + this.y, var7.z + this.z, var1);
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.RelativeMovement(this.x, this.y, this.z);
}
}
class="kw">public record SetBody(Direction direction) class="kw">implements PlayerInput.InputUpdate {
class="kw">public SetBody {
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
TransformComponent var4 = var2.getComponent(var3, TransformComponent.getComponentType());
if (var4 != null) {
var4.getRotation().set(this.direction.pitch, this.direction.yaw, this.direction.roll);
}
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.SetBody(this.direction.clone());
}
}
class="kw">public class="kw">static class SetClientVelocity class="kw">implements PlayerInput.InputUpdate {
class="kw">private class="kw">final Vector3d velocity;
class="kw">public SetClientVelocity(com.hypixel.hytale.protocol.Vector3d var1) {
this.velocity = new Vector3d(var1.x, var1.y, var1.z);
}
class="kw">public SetClientVelocity(Vector3d var1) {
this.velocity = var1;
}
class="kw">public Vector3d getVelocity() {
class="kw">return this.velocity;
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
Velocity var4 = var2.getComponent(var3, Velocity.getComponentType());
if (var4 != null) {
var4.setClient(this.velocity);
}
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.SetClientVelocity(new Vector3d(this.velocity));
}
}
class="kw">public record SetHead(Direction direction) class="kw">implements PlayerInput.InputUpdate {
class="kw">public SetHead {
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
HeadRotation var4 = var2.getComponent(var3, HeadRotation.getComponentType());
if (var4 != null) {
var4.getRotation().set(this.direction.pitch, this.direction.yaw, this.direction.roll);
}
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.SetHead(this.direction.clone());
}
}
class="kw">public record SetMovementStates(MovementStates movementStates) class="kw">implements PlayerInput.InputUpdate {
class="kw">public SetMovementStates {
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, @Nonnull ArchetypeChunk<EntityStore> var2, int var3) {
MovementStatesComponent var4 = var2.getComponent(var3, MovementStatesComponent.getComponentType());
if (var4 != null) {
var4.setMovementStates(this.movementStates);
}
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.SetMovementStates(this.movementStates.clone());
}
}
class="kw">public record SetRiderMovementStates(MovementStates movementStates) class="kw">implements PlayerInput.InputUpdate {
class="kw">public SetRiderMovementStates {
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3) {
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.SetRiderMovementStates(this.movementStates.clone());
}
}
class="kw">public class="kw">static class WishMovement class="kw">implements PlayerInput.InputUpdate {
class="kw">private double x;
class="kw">private double y;
class="kw">private double z;
class="kw">public WishMovement(double var1, double var3, double var5) {
this.x = var1;
this.y = var3;
this.z = var5;
}
class="kw">public double getX() {
class="kw">return this.x;
}
class="kw">public void setX(double var1) {
this.x = var1;
}
class="kw">public double getY() {
class="kw">return this.y;
}
class="kw">public void setY(double var1) {
this.y = var1;
}
class="kw">public double getZ() {
class="kw">return this.z;
}
class="kw">public void setZ(double var1) {
this.z = var1;
}
@Override
class="kw">public void apply(CommandBuffer<EntityStore> var1, ArchetypeChunk<EntityStore> var2, int var3) {
}
@Override
class="kw">public PlayerInput.InputUpdate clone() {
class="kw">return new PlayerInput.WishMovement(this.x, this.y, this.z);
}
}
}