mirror of
https://github.com/GTNewHorizons/FindIt.git
synced 2026-11-24 10:14:21 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d6ce05d9e | ||
|
|
0c2a7beed9 |
No files matched your search
+2
-2
@@ -1,6 +1,6 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.5.17-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.64:dev')
|
||||
implementation('com.github.GTNewHorizons:NotEnoughItems:2.5.18-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.68:dev')
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.gtnh.findit.util;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
|
||||
public class AxisUtils {
|
||||
|
||||
@@ -24,10 +23,10 @@ public class AxisUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static AxisPair calculateAxisPair(Vec3 player, ChunkPosition target) {
|
||||
double deltaX = target.chunkPosX - player.xCoord;
|
||||
double deltaY = target.chunkPosY - player.yCoord;
|
||||
double deltaZ = target.chunkPosZ - player.zCoord;
|
||||
public static AxisPair calculateAxisPair(Vec3 player, Vec3 target) {
|
||||
double deltaX = target.xCoord - player.xCoord;
|
||||
double deltaY = target.yCoord - player.yCoord;
|
||||
double deltaZ = target.zCoord - player.zCoord;
|
||||
|
||||
double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
|
||||
|
||||
|
||||
@@ -21,11 +21,15 @@ public class ClientFinderHelperUtils {
|
||||
|
||||
public static void rotateViewHelper(EntityClientPlayerMP player, List<ChunkPosition> targets) {
|
||||
Vec3 playerVec = player.getPosition(1.0F);
|
||||
ChunkPosition first = targets.remove(0);
|
||||
Vec3 first = center(targets.remove(0));
|
||||
|
||||
AxisUtils.AxisPair pair = AxisUtils.calculateAxisPair(playerVec, first);
|
||||
|
||||
player.rotationYaw = pair.yaw();
|
||||
player.rotationPitch = pair.pitch();
|
||||
}
|
||||
|
||||
public static Vec3 center(ChunkPosition p) {
|
||||
return Vec3.createVectorHelper(p.chunkPosX + 0.5, p.chunkPosY + 0.5, p.chunkPosZ + 0.5);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user