mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Move vectors to static creators, for caching
This commit is contained in:
committed by
IronApollo
parent
a9919d130c
commit
4d6045813c
@ -47,11 +47,11 @@ final class ForgeAdapter {
|
||||
}
|
||||
|
||||
public static Vector3 adapt(Vec3d vector) {
|
||||
return new Vector3(vector.x, vector.y, vector.z);
|
||||
return Vector3.at(vector.x, vector.y, vector.z);
|
||||
}
|
||||
|
||||
public static Vector3 adapt(BlockPos pos) {
|
||||
return new Vector3(pos.getX(), pos.getY(), pos.getZ());
|
||||
return Vector3.at(pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
public static Vec3d toVec3(BlockVector3 vector) {
|
||||
|
@ -66,7 +66,7 @@ class ForgeEntity implements Entity {
|
||||
public Location getLocation() {
|
||||
net.minecraft.entity.Entity entity = entityRef.get();
|
||||
if (entity != null) {
|
||||
Vector3 position = new Vector3(entity.posX, entity.posY, entity.posZ);
|
||||
Vector3 position = Vector3.at(entity.posX, entity.posY, entity.posZ);
|
||||
float yaw = entity.rotationYaw;
|
||||
float pitch = entity.rotationPitch;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class ForgePlayer extends AbstractPlayerActor {
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
Vector3 position = new Vector3(this.player.posX, this.player.posY, this.player.posZ);
|
||||
Vector3 position = Vector3.at(this.player.posX, this.player.posY, this.player.posZ);
|
||||
return new Location(
|
||||
ForgeWorldEdit.inst.getWorld(this.player.world),
|
||||
position,
|
||||
|
@ -449,7 +449,7 @@ public class ForgeWorld extends AbstractWorld {
|
||||
public List<? extends Entity> getEntities(Region region) {
|
||||
List<Entity> entities = new ArrayList<>();
|
||||
for (net.minecraft.entity.Entity entity : getWorld().loadedEntityList) {
|
||||
if (region.contains(new BlockVector3(entity.posX, entity.posY, entity.posZ))) {
|
||||
if (region.contains(BlockVector3.at(entity.posX, entity.posY, entity.posZ))) {
|
||||
entities.add(new ForgeEntity(entity));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user