mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 11:15:57 -07:00
Moved CraftVehicle.*Velocity() to CraftEntity as velocity is a component of all entities.
This commit is contained in:
@@ -4,6 +4,7 @@ package org.bukkit.craftbukkit;
|
||||
import net.minecraft.server.Entity;
|
||||
import net.minecraft.server.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Vector;
|
||||
import org.bukkit.World;
|
||||
|
||||
public abstract class CraftEntity implements org.bukkit.Entity {
|
||||
@@ -19,6 +20,16 @@ public abstract class CraftEntity implements org.bukkit.Entity {
|
||||
return new Location(getWorld(), entity.p, entity.q, entity.r, entity.v, entity.w);
|
||||
}
|
||||
|
||||
public Vector getVelocity() {
|
||||
return new Vector(entity.s, entity.t, entity.u);
|
||||
}
|
||||
|
||||
public void setVelocity(Vector vel) {
|
||||
entity.s = vel.getX();
|
||||
entity.t = vel.getY();
|
||||
entity.u = vel.getZ();
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return ((WorldServer)entity.l).getWorld();
|
||||
}
|
||||
|
Reference in New Issue
Block a user