Remove Vector usage

This commit is contained in:
TheMode 2021-07-08 18:59:40 +02:00
parent 45d7420397
commit 29b4fefb1a
3 changed files with 21 additions and 24 deletions

View File

@ -5,12 +5,11 @@ import net.minestom.server.command.builder.exception.ArgumentSyntaxException;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.network.packet.server.play.DeclareCommandsPacket;
import net.minestom.server.utils.StringUtils;
import net.minestom.server.utils.Vector;
import net.minestom.server.utils.location.RelativeVec;
import org.jetbrains.annotations.NotNull;
/**
* Represents a {@link Vector} with 2 floating numbers (x;z) which can take relative coordinates.
* Represents a {@link Vec} with 2 floating numbers (x;z) which can take relative coordinates.
* <p>
* Example: -1.2 ~
*/

View File

@ -5,12 +5,11 @@ import net.minestom.server.command.builder.exception.ArgumentSyntaxException;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.network.packet.server.play.DeclareCommandsPacket;
import net.minestom.server.utils.StringUtils;
import net.minestom.server.utils.Vector;
import net.minestom.server.utils.location.RelativeVec;
import org.jetbrains.annotations.NotNull;
/**
* Represents a {@link Vector} with 3 floating numbers (x;y;z) which can take relative coordinates.
* Represents a {@link Vec} with 3 floating numbers (x;y;z) which can take relative coordinates.
* <p>
* Example: -1.2 ~ 5
*/

View File

@ -1,10 +1,9 @@
package net.minestom.server.entity.metadata.other;
import net.minestom.server.coordinate.Vec;
import net.minestom.server.entity.Entity;
import net.minestom.server.entity.Metadata;
import net.minestom.server.entity.metadata.EntityMeta;
import net.minestom.server.entity.metadata.LivingEntityMeta;
import net.minestom.server.utils.Vector;
import org.jetbrains.annotations.NotNull;
public class ArmorStandMeta extends LivingEntityMeta {
@ -53,56 +52,56 @@ public class ArmorStandMeta extends LivingEntityMeta {
}
@NotNull
public Vector getHeadRotation() {
return super.metadata.getIndex(OFFSET + 1, new Vector(0D, 0D, 0D));
public Vec getHeadRotation() {
return super.metadata.getIndex(OFFSET + 1, Vec.ZERO);
}
public void setHeadRotation(@NotNull Vector value) {
public void setHeadRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 1, Metadata.Rotation(value));
}
@NotNull
public Vector getBodyRotation() {
return super.metadata.getIndex(OFFSET + 2, new Vector(0D, 0D, 0D));
public Vec getBodyRotation() {
return super.metadata.getIndex(OFFSET + 2, Vec.ZERO);
}
public void setBodyRotation(@NotNull Vector value) {
public void setBodyRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 2, Metadata.Rotation(value));
}
@NotNull
public Vector getLeftArmRotation() {
return super.metadata.getIndex(OFFSET + 3, new Vector(-10D, 0D, -10D));
public Vec getLeftArmRotation() {
return super.metadata.getIndex(OFFSET + 3, new Vec(-10D, 0D, -10D));
}
public void setLeftArmRotation(@NotNull Vector value) {
public void setLeftArmRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 3, Metadata.Rotation(value));
}
@NotNull
public Vector getRightArmRotation() {
return super.metadata.getIndex(OFFSET + 4, new Vector(-15D, 0D, 10D));
public Vec getRightArmRotation() {
return super.metadata.getIndex(OFFSET + 4, new Vec(-15D, 0D, 10D));
}
public void setRightArmRotation(@NotNull Vector value) {
public void setRightArmRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 4, Metadata.Rotation(value));
}
@NotNull
public Vector getLeftLegRotation() {
return super.metadata.getIndex(OFFSET + 5, new Vector(-1D, 0D, -1D));
public Vec getLeftLegRotation() {
return super.metadata.getIndex(OFFSET + 5, new Vec(-1D, 0D, -1D));
}
public void setLeftLegRotation(@NotNull Vector value) {
public void setLeftLegRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 5, Metadata.Rotation(value));
}
@NotNull
public Vector getRightLegRotation() {
return super.metadata.getIndex(OFFSET + 6, new Vector(1D, 0D, 1D));
public Vec getRightLegRotation() {
return super.metadata.getIndex(OFFSET + 6, new Vec(1D, 0D, 1D));
}
public void setRightLegRotation(@NotNull Vector value) {
public void setRightLegRotation(@NotNull Vec value) {
super.metadata.setIndex(OFFSET + 6, Metadata.Rotation(value));
}