类net.minecraft.util.Vec3i源码实例Demo

下面列出了怎么用net.minecraft.util.Vec3i的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Hyperium   文件: AnimationHandler.java
public void setPosition(RenderChunk rc, BlockPos bp) {
    if (!ChunkAnimatorConfig.enabled) return;
    if (Minecraft.getMinecraft().thePlayer != null) {
        boolean flag = true;
        BlockPos zeroedPlayerPosition = Minecraft.getMinecraft().thePlayer.getPosition();
        zeroedPlayerPosition = zeroedPlayerPosition.add(0, -zeroedPlayerPosition.getY(), 0);
        BlockPos zeroedCenteredChunkPos = bp.add(8, -bp.getY(), 8);

        if (ChunkAnimatorConfig.disableAroundPlayer) {
            flag = zeroedPlayerPosition.distanceSq(zeroedCenteredChunkPos) > (64 * 64);
        }

        if (flag) {
            EnumFacing chunkFacing = null;

            if (ChunkAnimatorConfig.mode.equals("From sides")) {
                Vec3i dif = zeroedPlayerPosition.subtract(zeroedCenteredChunkPos);
                int difX = Math.abs(dif.getX());
                int difZ = Math.abs(dif.getZ());
                chunkFacing = getFacing(dif, difX, difZ);
            }

            AnimationData animationData = new AnimationData(-1L, chunkFacing);
            timeStamps.put(rc, animationData);
        }
    }
}
 
源代码2 项目: ClientBase   文件: WrapperVec3i.java
public WrapperVec3i(Vec3i var1) {
    this.real = var1;
}
 
源代码3 项目: ClientBase   文件: WrapperVec3i.java
public Vec3i unwrap() {
    return this.real;
}
 
源代码4 项目: ClientBase   文件: WrapperVec3i.java
public WrapperVec3i getNULL_VECTOR() {
    return new WrapperVec3i(Vec3i.NULL_VECTOR);
}
 
源代码5 项目: Hyperium   文件: AnimationHandler.java
@NotNull
private EnumFacing getFacing(Vec3i dif, int difX, int difZ) {
    return difX > difZ ? dif.getX() > 0 ? EnumFacing.EAST : EnumFacing.WEST : dif.getZ() > 0 ? EnumFacing.SOUTH : EnumFacing.NORTH;
}
 
源代码6 项目: NOVA-Core   文件: VectorConverter.java
@Override
public Vector3D toNova(BlockPos pos) {
	return toNova((Vec3i) pos);
}
 
源代码7 项目: NOVA-Core   文件: VectorConverter.java
public Vector3D toNova(Vec3i pos) {
	return new Vector3D(pos.getX(), pos.getY(), pos.getZ());
}
 
 类所在包
 类方法
 同包方法